class A:
    def __init__(self, txt: str):
        self.q: D = None
        self.p: B = None
        self.w: B = None
        self.y: B = None
        self.o: G = None
        self.r: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: E = None
        self.v: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: G = None
        self.s: G = None
        self.r: D = None
        self.p: G = None
        self.z: B = None
        self.x: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: C = None
        self.x: A = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.p: E = None
        self.v: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: G = None
        self.s: G = None
        self.r: D = None
        self.p: G = None
        self.z: B = None
        self.x: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: C = None
        self.x: A = None
        self.txt = txt

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

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

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