class A:
    def __init__(self, txt: str):
        self.x: F = None
        self.q: A = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: B = None
        self.q: B = None
        self.x: B = None
        self.v: A = None
        self.w: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: A = None
        self.u: A = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.t: B = None
        self.q: B = None
        self.x: B = None
        self.v: A = None
        self.w: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: A = None
        self.u: A = None
        self.txt = txt

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

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

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