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

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

class C:
    def __init__(self, txt: str):
        self.t: D = None
        self.y: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: F = None
        self.v: C = None
        self.w: H = None
        self.o: H = None
        self.x: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: E = None
        self.q: G = None
        self.r: A = None
        self.t: H = None
        self.z: A = None
        self.w: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: A = None
        self.v: F = None
        self.o: C = None
        self.txt = txt

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

l = A("l")
d = B("d")
i = C("i")
e = D("e")
g = E("g")
c = F("c")
a = G("a")
m = H("m")
b = G("b")
n = A("n")

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

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

class C:
    def __init__(self, txt: str):
        self.t: D = None
        self.y: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: F = None
        self.v: C = None
        self.w: H = None
        self.o: H = None
        self.x: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: E = None
        self.q: G = None
        self.r: A = None
        self.t: H = None
        self.z: A = None
        self.w: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: A = None
        self.v: F = None
        self.o: C = None
        self.txt = txt

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

l = A("l")
d = B("d")
i = C("i")
e = D("e")
g = E("g")
c = F("c")
a = G("a")
m = H("m")
b = G("b")
n = A("n")

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