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

class B:
    def __init__(self, txt: str):
        self.w: D = None
        self.p: A = None
        self.r: H = None
        self.y: A = None
        self.v: G = None
        self.q: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.z: H = None
        self.w: E = None
        self.o: E = None
        self.p: G = None
        self.q: G = None
        self.txt = txt

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

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

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

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

c = A("c")
g = B("g")
l = C("l")
b = D("b")
j = E("j")
f = F("f")
k = G("k")
d = H("d")

c.t = d
c.u = b
g.w = b
g.p = c
g.y = c
g.r = d
g.v = k
g.q = l
l.y = g
b.z = d
b.w = j
b.o = j
b.p = k
b.q = k
j.v = l
f.v = k
f.x = b
f.w = g
k.v = l
k.s = c
d.u = j
assert l.y.v.v.y.y.u.q.txt == "
class A:
    def __init__(self, txt: str):
        self.t: H = None
        self.u: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: D = None
        self.p: A = None
        self.r: H = None
        self.y: A = None
        self.v: G = None
        self.q: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.z: H = None
        self.w: E = None
        self.o: E = None
        self.p: G = None
        self.q: G = None
        self.txt = txt

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

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

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

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

c = A("c")
g = B("g")
l = C("l")
b = D("b")
j = E("j")
f = F("f")
k = G("k")
d = H("d")

c.t = d
c.u = b
g.w = b
g.p = c
g.y = c
g.r = d
g.v = k
g.q = l
l.y = g
b.z = d
b.w = j
b.o = j
b.p = k
b.q = k
j.v = l
f.v = k
f.x = b
f.w = g
k.v = l
k.s = c
d.u = j
assert l.y.v.v.y.y.u.q.txt == "k"