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

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.t: A = None
        self.p: D = None
        self.y: D = None
        self.s: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.w: D = None
        self.t: C = None
        self.q: F = None
        self.r: C = None
        self.txt = txt

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

l = A("l")
b = B("b")
h = C("h")
e = D("e")
i = E("i")
g = F("g")
k = F("k")

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

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.t: A = None
        self.p: D = None
        self.y: D = None
        self.s: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.w: D = None
        self.t: C = None
        self.q: F = None
        self.r: C = None
        self.txt = txt

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

l = A("l")
b = B("b")
h = C("h")
e = D("e")
i = E("i")
g = F("g")
k = F("k")

l.y = b
b.v = l
b.t = l
b.p = e
b.y = e
b.s = h
h.t = b
e.y = k
e.x = k
e.t = l
e.p = h
e.u = g
i.w = e
i.t = h
i.r = h
i.q = k
g.z = i
g.u = b
g.s = b
k.z = i
k.u = b
k.s = b
assert b.s.t.y.p.txt == "h"