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

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

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

class D:
    def __init__(self, txt: str):
        self.t: D = None
        self.y: B = None
        self.v: D = None
        self.x: B = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.t: D = None
        self.y: B = None
        self.v: D = None
        self.x: B = None
        self.txt = txt

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

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

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

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