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

class B:
    def __init__(self, txt: str):
        self.w: F = None
        self.y: D = None
        self.o: A = None
        self.p: E = None
        self.q: D = None
        self.t: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: B = None
        self.w: C = None
        self.r: D = None
        self.o: B = None
        self.z: B = None
        self.x: B = None
        self.txt = txt

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

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

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

n = A("n")
h = B("h")
d = C("d")
f = D("f")
m = E("m")
j = F("j")
k = F("k")
l = C("l")

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

class B:
    def __init__(self, txt: str):
        self.w: F = None
        self.y: D = None
        self.o: A = None
        self.p: E = None
        self.q: D = None
        self.t: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: B = None
        self.w: C = None
        self.r: D = None
        self.o: B = None
        self.z: B = None
        self.x: B = None
        self.txt = txt

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

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

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

n = A("n")
h = B("h")
d = C("d")
f = D("f")
m = E("m")
j = F("j")
k = F("k")
l = C("l")

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