class A:
    def __init__(self, txt: str):
        self.p: G = None
        self.v: H = None
        self.q: B = None
        self.r: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: G = None
        self.z: H = None
        self.p: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: B = None
        self.v: F = None
        self.y: E = None
        self.z: F = None
        self.o: F = None
        self.q: E = None
        self.x: E = None
        self.p: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: B = None
        self.o: C = None
        self.p: G = None
        self.r: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: G = None
        self.w: H = None
        self.o: E = None
        self.z: H = None
        self.v: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: H = None
        self.y: H = None
        self.o: F = None
        self.s: C = None
        self.q: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: E = None
        self.w: G = None
        self.txt = txt

d = A("d")
j = B("j")
k = C("k")
l = D("l")
a = E("a")
e = F("e")
c = G("c")
h = H("h")

d.p = c
d.v = h
d.q = j
d.r = l
j.u = c
j.z = h
j.p = e
k.t = j
k.v = e
k.z = e
k.o = e
k.p = e
k.y = a
k.q = a
k.x = a
l.v = j
l.o = k
l.p = c
l.r = c
a.z = h
e.p = c
e.w = h
e.z = h
e.o = a
e.v = a
c.r = h
c.y = h
c.o = e
c.s = k
c.q = k
h.y = a
h.w = c
assert l.o.p.z.y.z.w.txt == "
class A:
    def __init__(self, txt: str):
        self.p: G = None
        self.v: H = None
        self.q: B = None
        self.r: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: G = None
        self.z: H = None
        self.p: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: B = None
        self.v: F = None
        self.y: E = None
        self.z: F = None
        self.o: F = None
        self.q: E = None
        self.x: E = None
        self.p: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: B = None
        self.o: C = None
        self.p: G = None
        self.r: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: G = None
        self.w: H = None
        self.o: E = None
        self.z: H = None
        self.v: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: H = None
        self.y: H = None
        self.o: F = None
        self.s: C = None
        self.q: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: E = None
        self.w: G = None
        self.txt = txt

d = A("d")
j = B("j")
k = C("k")
l = D("l")
a = E("a")
e = F("e")
c = G("c")
h = H("h")

d.p = c
d.v = h
d.q = j
d.r = l
j.u = c
j.z = h
j.p = e
k.t = j
k.v = e
k.z = e
k.o = e
k.p = e
k.y = a
k.q = a
k.x = a
l.v = j
l.o = k
l.p = c
l.r = c
a.z = h
e.p = c
e.w = h
e.z = h
e.o = a
e.v = a
c.r = h
c.y = h
c.o = e
c.s = k
c.q = k
h.y = a
h.w = c
assert l.o.p.z.y.z.w.txt == "c"