class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.q: D = None
        self.z: E = None
        self.y: B = None
        self.o: D = None
        self.p: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: F = None
        self.v: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: G = None
        self.p: E = None
        self.o: F = None
        self.u: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: E = None
        self.t: C = None
        self.s: G = None
        self.y: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: A = None
        self.txt = txt

l = A("l")
n = B("n")
i = C("i")
a = D("a")
j = E("j")
e = F("e")
h = G("h")

l.v = a
l.q = a
l.o = a
l.p = a
l.z = j
l.y = n
n.t = e
n.v = l
i.t = h
i.p = j
i.o = e
i.u = n
a.r = h
j.z = i
e.r = j
e.t = i
e.s = h
e.y = n
h.t = l
assert h.t.y.v.p.txt == "
class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.q: D = None
        self.z: E = None
        self.y: B = None
        self.o: D = None
        self.p: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: F = None
        self.v: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: G = None
        self.p: E = None
        self.o: F = None
        self.u: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: E = None
        self.t: C = None
        self.s: G = None
        self.y: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: A = None
        self.txt = txt

l = A("l")
n = B("n")
i = C("i")
a = D("a")
j = E("j")
e = F("e")
h = G("h")

l.v = a
l.q = a
l.o = a
l.p = a
l.z = j
l.y = n
n.t = e
n.v = l
i.t = h
i.p = j
i.o = e
i.u = n
a.r = h
j.z = i
e.r = j
e.t = i
e.s = h
e.y = n
h.t = l
assert h.t.y.v.p.txt == "a"