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

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: B = None
        self.txt = txt

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

e = A("e")
d = B("d")
i = C("i")
k = D("k")
c = E("c")
b = F("b")
n = F("n")
g = E("g")
f = A("f")
m = C("m")

e.t = k
e.o = g
e.u = b
d.q = b
d.y = n
d.t = k
i.x = e
i.t = e
i.o = g
i.q = g
i.y = k
i.s = n
k.t = f
c.q = d
b.x = f
b.r = n
b.p = i
b.y = d
n.x = e
n.r = b
n.p = i
n.y = d
g.q = d
f.t = k
f.o = c
f.u = b
m.x = f
m.t = f
m.o = c
m.q = c
m.y = k
m.s = b
assert m.t.u.r.txt == "
class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.o: E = None
        self.u: F = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: B = None
        self.txt = txt

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

e = A("e")
d = B("d")
i = C("i")
k = D("k")
c = E("c")
b = F("b")
n = F("n")
g = E("g")
f = A("f")
m = C("m")

e.t = k
e.o = g
e.u = b
d.q = b
d.y = n
d.t = k
i.x = e
i.t = e
i.o = g
i.q = g
i.y = k
i.s = n
k.t = f
c.q = d
b.x = f
b.r = n
b.p = i
b.y = d
n.x = e
n.r = b
n.p = i
n.y = d
g.q = d
f.t = k
f.o = c
f.u = b
m.x = f
m.t = f
m.o = c
m.q = c
m.y = k
m.s = b
assert m.t.u.r.txt == "n"