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

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

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

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.z: D = None
        self.r: F = None
        self.v: B = None
        self.s: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: A = None
        self.p: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: D = None
        self.s: C = None
        self.q: B = None
        self.v: A = None
        self.y: C = None
        self.u: G = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.z: D = None
        self.r: F = None
        self.v: B = None
        self.s: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: A = None
        self.p: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: D = None
        self.s: C = None
        self.q: B = None
        self.v: A = None
        self.y: C = None
        self.u: G = None
        self.txt = txt

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

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

g.p = a
j.o = c
j.r = g
a.z = c
m.t = a
m.z = h
m.r = d
m.v = j
m.s = f
c.s = g
c.p = d
d.z = h
d.s = e
d.q = j
d.v = g
d.y = a
d.u = f
f.q = d
i.q = d
e.z = c
h.t = a
h.z = m
h.r = d
h.v = j
h.s = i
assert f.q.u.q.u.q.z.v.o.txt == "c"