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

class B:
    def __init__(self, txt: str):
        self.q: C = None
        self.w: D = None
        self.o: B = None
        self.x: F = None
        self.u: E = None
        self.z: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.s: A = None
        self.v: B = None
        self.o: F = None
        self.txt = txt

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

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

d.q = a
d.t = a
j.q = g
j.w = m
j.o = n
j.x = h
j.u = a
j.z = a
g.v = a
f.t = a
a.r = l
a.s = d
a.v = j
a.o = h
h.z = a
h.x = j
h.s = g
l.t = a
n.q = g
n.w = l
n.o = j
n.x = h
n.u = a
n.z = a
c.q = a
c.t = a
m.t = a
assert c.t.v.u.r.t.v.o.q.txt == "
class A:
    def __init__(self, txt: str):
        self.q: E = None
        self.t: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: C = None
        self.w: D = None
        self.o: B = None
        self.x: F = None
        self.u: E = None
        self.z: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.s: A = None
        self.v: B = None
        self.o: F = None
        self.txt = txt

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

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

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