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

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

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.p: F = None
        self.u: A = None
        self.x: A = None
        self.s: F = None
        self.o: F = None
        self.v: F = None
        self.q: A = None
        self.z: C = None
        self.txt = txt

l = A("l")
h = B("h")
c = C("c")
i = D("i")
m = E("m")
f = F("f")
b = G("b")
e = H("e")
d = A("d")
j = D("j")

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

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

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.p: F = None
        self.u: A = None
        self.x: A = None
        self.s: F = None
        self.o: F = None
        self.v: F = None
        self.q: A = None
        self.z: C = None
        self.txt = txt

l = A("l")
h = B("h")
c = C("c")
i = D("i")
m = E("m")
f = F("f")
b = G("b")
e = H("e")
d = A("d")
j = D("j")

l.t = d
h.w = m
h.y = b
h.z = i
c.q = b
c.z = b
i.x = h
m.o = d
m.w = d
f.x = b
b.o = l
e.p = f
e.s = f
e.o = f
e.v = f
e.u = l
e.q = l
e.x = d
e.z = c
d.t = l
j.x = h
assert l.t.t.t.t.t.t.t.t.t.t.txt == "l"