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

class B:
    def __init__(self, txt: str):
        self.q: C = None
        self.z: F = None
        self.t: C = None
        self.p: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.z: C = None
        self.q: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

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

j = A("j")
m = B("m")
n = C("n")
b = D("b")
a = E("a")
l = F("l")
k = G("k")
f = F("f")
c = C("c")

j.t = f
j.p = f
j.v = l
j.z = b
m.q = n
m.z = l
m.t = c
m.p = j
n.q = b
n.r = c
b.r = a
b.s = n
a.p = m
a.z = c
a.q = k
l.u = j
k.q = j
k.s = j
k.r = j
k.o = m
f.u = j
c.q = b
c.r = n
assert a.z.r.q.r.p.p.t.u.txt == "
class A:
    def __init__(self, txt: str):
        self.t: F = None
        self.v: F = None
        self.z: D = None
        self.p: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: C = None
        self.z: F = None
        self.t: C = None
        self.p: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.z: C = None
        self.q: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

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

j = A("j")
m = B("m")
n = C("n")
b = D("b")
a = E("a")
l = F("l")
k = G("k")
f = F("f")
c = C("c")

j.t = f
j.p = f
j.v = l
j.z = b
m.q = n
m.z = l
m.t = c
m.p = j
n.q = b
n.r = c
b.r = a
b.s = n
a.p = m
a.z = c
a.q = k
l.u = j
k.q = j
k.s = j
k.r = j
k.o = m
f.u = j
c.q = b
c.r = n
assert a.z.r.q.r.p.p.t.u.txt == "j"