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

class B:
    def __init__(self, txt: str):
        self.y: B = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: B = None
        self.w: B = None
        self.s: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.s: H = None
        self.o: H = None
        self.v: C = None
        self.q: A = None
        self.r: H = None
        self.z: A = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.y: B = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: B = None
        self.w: B = None
        self.s: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.s: H = None
        self.o: H = None
        self.v: C = None
        self.q: A = None
        self.r: H = None
        self.z: A = None
        self.txt = txt

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

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

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

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

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