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

class B:
    def __init__(self, txt: str):
        self.w: E = None
        self.t: E = None
        self.r: H = None
        self.p: A = None
        self.o: C = None
        self.u: D = None
        self.x: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: A = None
        self.v: G = None
        self.p: C = None
        self.w: A = None
        self.u: H = None
        self.r: D = None
        self.x: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.p: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: B = None
        self.p: F = None
        self.z: G = None
        self.t: F = None
        self.v: G = None
        self.q: G = None
        self.u: G = None
        self.txt = txt

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

a = A("a")
b = B("b")
f = C("f")
k = D("k")
h = E("h")
g = F("g")
l = G("l")
c = H("c")
d = C("d")
m = G("m")

a.u = b
a.x = k
a.t = c
a.w = g
a.p = m
b.w = h
b.t = h
b.r = c
b.p = a
b.x = a
b.o = f
b.u = k
f.z = a
f.w = a
f.v = l
f.p = d
f.u = c
f.r = k
f.x = b
k.z = b
k.o = b
h.s = b
h.t = l
h.x = k
g.p = l
l.s = b
l.p = g
l.t = g
l.z = m
l.v = m
l.q = m
l.u = m
c.r = g
d.z = a
d.w = a
d.v = m
d.p = f
d.u = c
d.r = k
d.x = b
m.s = b
m.p = g
m.t = g
m.z = l
m.v = l
m.q = l
m.u = l
assert l.s.r.r.p.p.p.v.p.p.txt == "
class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.x: D = None
        self.t: H = None
        self.w: F = None
        self.p: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: E = None
        self.t: E = None
        self.r: H = None
        self.p: A = None
        self.o: C = None
        self.u: D = None
        self.x: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: A = None
        self.v: G = None
        self.p: C = None
        self.w: A = None
        self.u: H = None
        self.r: D = None
        self.x: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.p: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: B = None
        self.p: F = None
        self.z: G = None
        self.t: F = None
        self.v: G = None
        self.q: G = None
        self.u: G = None
        self.txt = txt

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

a = A("a")
b = B("b")
f = C("f")
k = D("k")
h = E("h")
g = F("g")
l = G("l")
c = H("c")
d = C("d")
m = G("m")

a.u = b
a.x = k
a.t = c
a.w = g
a.p = m
b.w = h
b.t = h
b.r = c
b.p = a
b.x = a
b.o = f
b.u = k
f.z = a
f.w = a
f.v = l
f.p = d
f.u = c
f.r = k
f.x = b
k.z = b
k.o = b
h.s = b
h.t = l
h.x = k
g.p = l
l.s = b
l.p = g
l.t = g
l.z = m
l.v = m
l.q = m
l.u = m
c.r = g
d.z = a
d.w = a
d.v = m
d.p = f
d.u = c
d.r = k
d.x = b
m.s = b
m.p = g
m.t = g
m.z = l
m.v = l
m.q = l
m.u = l
assert l.s.r.r.p.p.p.v.p.p.txt == "l"