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

class B:
    def __init__(self, txt: str):
        self.q: A = None
        self.y: D = None
        self.u: D = None
        self.o: A = None
        self.v: D = None
        self.t: B = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: D = None
        self.w: F = None
        self.u: G = None
        self.z: F = None
        self.y: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.y: G = None
        self.u: C = None
        self.q: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: G = None
        self.r: D = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.q: A = None
        self.y: D = None
        self.u: D = None
        self.o: A = None
        self.v: D = None
        self.t: B = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: D = None
        self.w: F = None
        self.u: G = None
        self.z: F = None
        self.y: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.y: G = None
        self.u: C = None
        self.q: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: G = None
        self.r: D = None
        self.txt = txt

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

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

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