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

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

class C:
    def __init__(self, txt: str):
        self.q: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: C = None
        self.t: C = None
        self.u: A = None
        self.v: G = None
        self.p: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: C = None
        self.s: H = None
        self.y: H = None
        self.r: G = None
        self.q: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: C = None
        self.u: B = None
        self.v: A = None
        self.t: G = None
        self.o: C = None
        self.w: H = None
        self.x: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.v: D = None
        self.x: D = None
        self.s: A = None
        self.t: F = None
        self.p: B = None
        self.z: E = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.q: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: C = None
        self.t: C = None
        self.u: A = None
        self.v: G = None
        self.p: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: C = None
        self.s: H = None
        self.y: H = None
        self.r: G = None
        self.q: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: C = None
        self.u: B = None
        self.v: A = None
        self.t: G = None
        self.o: C = None
        self.w: H = None
        self.x: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.v: D = None
        self.x: D = None
        self.s: A = None
        self.t: F = None
        self.p: B = None
        self.z: E = None
        self.txt = txt

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

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