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

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

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

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

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

b = A("b")
d = B("d")
c = C("c")
e = D("e")
i = E("i")
f = C("f")

b.t = d
d.o = c
c.x = e
c.q = i
c.r = i
c.w = f
e.v = b
i.y = c
f.x = e
f.q = i
f.r = i
f.w = c
assert i.y.r.y.q.txt == "
class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.txt = txt

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

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

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

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

b = A("b")
d = B("d")
c = C("c")
e = D("e")
i = E("i")
f = C("f")

b.t = d
d.o = c
c.x = e
c.q = i
c.r = i
c.w = f
e.v = b
i.y = c
f.x = e
f.q = i
f.r = i
f.w = c
assert i.y.r.y.q.txt == "i"