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

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

class C:
    def __init__(self, txt: str):
        self.t: E = None
        self.q: E = None
        self.s: F = None
        self.u: G = None
        self.o: B = None
        self.y: A = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.v: H = None
        self.r: F = None
        self.txt = txt

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

d = A("d")
m = B("m")
i = C("i")
a = D("a")
h = E("h")
l = F("l")
n = G("n")
f = H("f")
b = H("b")

d.v = n
m.p = b
i.t = h
i.q = h
i.s = l
i.u = n
i.o = m
i.y = d
a.q = h
h.u = a
l.u = h
n.v = f
n.r = l
f.t = m
f.z = h
f.o = h
b.t = m
b.z = h
b.o = h
assert i.o.p.t.p.txt == "
class A:
    def __init__(self, txt: str):
        self.v: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: E = None
        self.q: E = None
        self.s: F = None
        self.u: G = None
        self.o: B = None
        self.y: A = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.v: H = None
        self.r: F = None
        self.txt = txt

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

d = A("d")
m = B("m")
i = C("i")
a = D("a")
h = E("h")
l = F("l")
n = G("n")
f = H("f")
b = H("b")

d.v = n
m.p = b
i.t = h
i.q = h
i.s = l
i.u = n
i.o = m
i.y = d
a.q = h
h.u = a
l.u = h
n.v = f
n.r = l
f.t = m
f.z = h
f.o = h
b.t = m
b.z = h
b.o = h
assert i.o.p.t.p.txt == "b"