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

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

class C:
    def __init__(self, txt: str):
        self.t: G = None
        self.x: H = None
        self.w: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: H = None
        self.v: B = None
        self.q: B = None
        self.u: G = None
        self.r: D = None
        self.p: B = None
        self.t: A = None
        self.s: H = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.v: D = None
        self.q: D = None
        self.w: B = None
        self.u: D = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.t: G = None
        self.x: H = None
        self.w: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: H = None
        self.v: B = None
        self.q: B = None
        self.u: G = None
        self.r: D = None
        self.p: B = None
        self.t: A = None
        self.s: H = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.v: D = None
        self.q: D = None
        self.w: B = None
        self.u: D = None
        self.txt = txt

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

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