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

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

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

class D:
    def __init__(self, txt: str):
        self.w: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: D = None
        self.t: C = None
        self.s: C = None
        self.w: G = None
        self.p: D = None
        self.o: B = None
        self.q: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: F = None
        self.p: G = None
        self.z: D = None
        self.r: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: A = None
        self.p: D = None
        self.txt = txt

a = A("a")
i = B("i")
f = C("f")
e = D("e")
c = E("c")
j = F("j")
d = G("d")
k = F("k")
m = F("m")
n = B("n")

a.t = f
i.u = e
i.v = c
f.v = a
e.w = m
c.x = e
c.p = e
c.t = f
c.s = f
c.w = d
c.q = d
c.o = i
j.s = k
j.p = d
j.r = d
j.z = e
d.o = a
d.p = e
k.s = m
k.p = d
k.r = d
k.z = e
m.s = j
m.p = d
m.r = d
m.z = e
n.u = e
n.v = c
assert c.q.o.t.v.t.v.t.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.w: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: D = None
        self.t: C = None
        self.s: C = None
        self.w: G = None
        self.p: D = None
        self.o: B = None
        self.q: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: F = None
        self.p: G = None
        self.z: D = None
        self.r: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: A = None
        self.p: D = None
        self.txt = txt

a = A("a")
i = B("i")
f = C("f")
e = D("e")
c = E("c")
j = F("j")
d = G("d")
k = F("k")
m = F("m")
n = B("n")

a.t = f
i.u = e
i.v = c
f.v = a
e.w = m
c.x = e
c.p = e
c.t = f
c.s = f
c.w = d
c.q = d
c.o = i
j.s = k
j.p = d
j.r = d
j.z = e
d.o = a
d.p = e
k.s = m
k.p = d
k.r = d
k.z = e
m.s = j
m.p = d
m.r = d
m.z = e
n.u = e
n.v = c
assert c.q.o.t.v.t.v.t.txt == "f"