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

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: A = None
        self.t: F = None
        self.o: F = None
        self.q: E = None
        self.w: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: B = None
        self.t: A = None
        self.u: C = None
        self.s: E = None
        self.y: B = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: A = None
        self.t: F = None
        self.o: F = None
        self.q: E = None
        self.w: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: B = None
        self.t: A = None
        self.u: C = None
        self.s: E = None
        self.y: B = None
        self.txt = txt

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

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