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

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

class C:
    def __init__(self, txt: str):
        self.t: E = None
        self.u: D = None
        self.y: A = None
        self.o: B = None
        self.w: C = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: F = None
        self.txt = txt

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

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

d = A("d")
b = B("b")
e = C("e")
a = D("a")
j = E("j")
n = F("n")
f = C("f")
i = E("i")
m = D("m")
l = F("l")

d.t = f
b.t = m
b.p = n
e.t = j
e.u = a
e.y = d
e.o = b
e.w = f
a.r = n
j.y = i
j.o = b
j.v = a
n.t = e
n.z = a
n.o = d
n.r = b
f.t = j
f.u = a
f.y = d
f.o = b
f.w = e
i.y = j
i.o = b
i.v = m
m.r = n
l.t = f
l.z = a
l.o = d
l.r = b
assert b.t.r.o.t.t.v.r.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: E = None
        self.u: D = None
        self.y: A = None
        self.o: B = None
        self.w: C = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: F = None
        self.txt = txt

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

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

d = A("d")
b = B("b")
e = C("e")
a = D("a")
j = E("j")
n = F("n")
f = C("f")
i = E("i")
m = D("m")
l = F("l")

d.t = f
b.t = m
b.p = n
e.t = j
e.u = a
e.y = d
e.o = b
e.w = f
a.r = n
j.y = i
j.o = b
j.v = a
n.t = e
n.z = a
n.o = d
n.r = b
f.t = j
f.u = a
f.y = d
f.o = b
f.w = e
i.y = j
i.o = b
i.v = m
m.r = n
l.t = f
l.z = a
l.o = d
l.r = b
assert b.t.r.o.t.t.v.r.txt == "n"