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

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

class C:
    def __init__(self, txt: str):
        self.y: F = None
        self.x: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: C = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.p: E = None
        self.w: G = None
        self.o: D = None
        self.t: F = None
        self.y: D = None
        self.r: E = None
        self.v: C = None
        self.txt = txt

b = A("b")
e = B("e")
f = C("f")
l = D("l")
h = E("h")
k = F("k")
c = G("c")
n = H("n")
g = F("g")

b.t = h
e.t = l
f.y = g
f.x = b
l.v = f
h.o = c
k.z = b
k.s = h
c.q = h
c.p = e
c.y = l
n.p = h
n.r = h
n.w = c
n.o = l
n.y = l
n.t = g
n.v = f
g.z = b
g.s = h
assert b.t.o.q.o.p.t.txt == "
class A:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: F = None
        self.x: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: C = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.p: E = None
        self.w: G = None
        self.o: D = None
        self.t: F = None
        self.y: D = None
        self.r: E = None
        self.v: C = None
        self.txt = txt

b = A("b")
e = B("e")
f = C("f")
l = D("l")
h = E("h")
k = F("k")
c = G("c")
n = H("n")
g = F("g")

b.t = h
e.t = l
f.y = g
f.x = b
l.v = f
h.o = c
k.z = b
k.s = h
c.q = h
c.p = e
c.y = l
n.p = h
n.r = h
n.w = c
n.o = l
n.y = l
n.t = g
n.v = f
g.z = b
g.s = h
assert b.t.o.q.o.p.t.txt == "l"