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

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.o: C = None
        self.y: F = None
        self.z: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.p: A = None
        self.w: F = None
        self.r: C = None
        self.o: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: C = None
        self.s: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.o: C = None
        self.y: F = None
        self.z: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.p: A = None
        self.w: F = None
        self.r: C = None
        self.o: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: C = None
        self.s: C = None
        self.txt = txt

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

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