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

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

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

class D:
    def __init__(self, txt: str):
        self.x: F = None
        self.t: B = None
        self.s: C = None
        self.p: B = None
        self.q: D = None
        self.r: B = None
        self.txt = txt

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

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

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

a.r = f
f.r = b
b.r = e
i.x = e
i.t = f
i.p = f
i.r = f
i.s = l
i.q = d
j.y = f
e.t = j
e.s = j
e.u = b
e.y = d
e.q = f
d.x = e
d.t = f
d.p = f
d.r = f
d.s = l
d.q = i
l.r = e
assert b.r.u.r.txt == "
class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.x: F = None
        self.t: B = None
        self.s: C = None
        self.p: B = None
        self.q: D = None
        self.r: B = None
        self.txt = txt

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

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

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

a.r = f
f.r = b
b.r = e
i.x = e
i.t = f
i.p = f
i.r = f
i.s = l
i.q = d
j.y = f
e.t = j
e.s = j
e.u = b
e.y = d
e.q = f
d.x = e
d.t = f
d.p = f
d.r = f
d.s = l
d.q = i
l.r = e
assert b.r.u.r.txt == "e"