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

class B:
    def __init__(self, txt: str):
        self.y: C = None
        self.x: A = None
        self.v: A = None
        self.r: E = None
        self.w: G = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: B = 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.u: C = None
        self.txt = txt

k = A("k")
f = B("f")
a = C("a")
d = D("d")
n = E("n")
j = F("j")
c = G("c")
i = H("i")
l = D("l")

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

class B:
    def __init__(self, txt: str):
        self.y: C = None
        self.x: A = None
        self.v: A = None
        self.r: E = None
        self.w: G = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: B = 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.u: C = None
        self.txt = txt

k = A("k")
f = B("f")
a = C("a")
d = D("d")
n = E("n")
j = F("j")
c = G("c")
i = H("i")
l = D("l")

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