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

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

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

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

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

d = A("d")
a = B("a")
b = C("b")
f = D("f")
c = E("c")
j = E("j")
e = B("e")
n = A("n")

d.z = f
d.t = f
a.v = j
a.u = j
b.x = f
f.q = j
c.w = a
c.u = b
c.o = e
c.v = j
j.w = a
j.o = a
j.u = b
j.v = c
e.v = c
e.u = j
n.z = f
n.t = f
assert f.q.w.u.v.v.u.x.txt == "
class A:
    def __init__(self, txt: str):
        self.z: D = None
        self.t: D = None
        self.txt = txt

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

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

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

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

d = A("d")
a = B("a")
b = C("b")
f = D("f")
c = E("c")
j = E("j")
e = B("e")
n = A("n")

d.z = f
d.t = f
a.v = j
a.u = j
b.x = f
f.q = j
c.w = a
c.u = b
c.o = e
c.v = j
j.w = a
j.o = a
j.u = b
j.v = c
e.v = c
e.u = j
n.z = f
n.t = f
assert f.q.w.u.v.v.u.x.txt == "f"