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

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

class C:
    def __init__(self, txt: str):
        self.z: C = 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.x: C = None
        self.r: D = None
        self.z: F = None
        self.s: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: C = None
        self.u: B = None
        self.s: C = None
        self.o: D = None
        self.q: D = None
        self.p: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: F = None
        self.o: G = None
        self.txt = txt

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

j.t = l
j.z = c
j.p = h
j.s = h
j.o = k
c.q = n
c.r = f
c.o = f
c.y = k
e.z = l
i.o = h
h.x = e
h.r = i
h.z = f
h.s = n
f.z = l
f.s = l
f.u = c
f.o = i
f.q = i
f.p = i
n.x = f
n.o = k
l.z = e
k.x = f
k.o = n
assert f.q.o.x.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.z: B = None
        self.p: E = None
        self.s: E = None
        self.o: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: C = 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.x: C = None
        self.r: D = None
        self.z: F = None
        self.s: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: C = None
        self.u: B = None
        self.s: C = None
        self.o: D = None
        self.q: D = None
        self.p: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: F = None
        self.o: G = None
        self.txt = txt

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

j.t = l
j.z = c
j.p = h
j.s = h
j.o = k
c.q = n
c.r = f
c.o = f
c.y = k
e.z = l
i.o = h
h.x = e
h.r = i
h.z = f
h.s = n
f.z = l
f.s = l
f.u = c
f.o = i
f.q = i
f.p = i
n.x = f
n.o = k
l.z = e
k.x = f
k.o = n
assert f.q.o.x.txt == "e"