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

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

class C:
    def __init__(self, txt: str):
        self.q: D = None
        self.r: E = None
        self.x: E = None
        self.z: A = None
        self.v: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: E = None
        self.z: E = None
        self.s: B = None
        self.y: B = None
        self.r: A = None
        self.txt = txt

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

j = A("j")
a = B("a")
i = C("i")
g = D("g")
c = E("c")
e = F("e")
f = E("f")
b = E("b")
d = F("d")

j.t = i
a.r = f
a.p = f
a.s = j
a.o = g
i.q = g
i.r = f
i.x = c
i.z = j
i.v = a
g.x = i
c.v = f
c.z = b
c.s = a
c.y = a
c.r = j
e.s = i
e.r = i
e.y = g
e.x = g
e.w = g
e.o = j
f.v = c
f.z = c
f.s = a
f.y = a
f.r = j
b.v = f
b.z = c
b.s = a
b.y = a
b.r = j
d.s = i
d.r = i
d.y = g
d.x = g
d.w = g
d.o = j
assert j.t.r.r.t.q.x.x.r.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.q: D = None
        self.r: E = None
        self.x: E = None
        self.z: A = None
        self.v: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: E = None
        self.z: E = None
        self.s: B = None
        self.y: B = None
        self.r: A = None
        self.txt = txt

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

j = A("j")
a = B("a")
i = C("i")
g = D("g")
c = E("c")
e = F("e")
f = E("f")
b = E("b")
d = F("d")

j.t = i
a.r = f
a.p = f
a.s = j
a.o = g
i.q = g
i.r = f
i.x = c
i.z = j
i.v = a
g.x = i
c.v = f
c.z = b
c.s = a
c.y = a
c.r = j
e.s = i
e.r = i
e.y = g
e.x = g
e.w = g
e.o = j
f.v = c
f.z = c
f.s = a
f.y = a
f.r = j
b.v = f
b.z = c
b.s = a
b.y = a
b.r = j
d.s = i
d.r = i
d.y = g
d.x = g
d.w = g
d.o = j
assert j.t.r.r.t.q.x.x.r.txt == "j"