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

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

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

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

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

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

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

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

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

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

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

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

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

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

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