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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: H = None
        self.q: A = None
        self.r: D = None
        self.u: A = None
        self.txt = txt

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

m = A("m")
l = B("l")
g = C("g")
d = D("d")
j = E("j")
i = F("i")
k = G("k")
c = H("c")
e = F("e")
f = H("f")

m.u = c
l.s = k
l.y = j
l.w = j
l.v = d
l.r = c
l.z = c
l.p = f
l.u = g
g.u = c
g.r = i
d.z = l
d.w = g
d.t = e
d.v = f
d.p = k
j.q = k
j.y = e
j.r = e
j.w = e
j.u = e
j.z = m
j.p = g
j.o = d
i.s = j
k.v = f
k.q = m
k.u = m
k.r = d
c.z = i
c.r = l
e.s = j
f.z = e
f.r = l
assert m.u.z.s.p.txt == "
class A:
    def __init__(self, txt: str):
        self.u: H = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: H = None
        self.q: A = None
        self.r: D = None
        self.u: A = None
        self.txt = txt

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

m = A("m")
l = B("l")
g = C("g")
d = D("d")
j = E("j")
i = F("i")
k = G("k")
c = H("c")
e = F("e")
f = H("f")

m.u = c
l.s = k
l.y = j
l.w = j
l.v = d
l.r = c
l.z = c
l.p = f
l.u = g
g.u = c
g.r = i
d.z = l
d.w = g
d.t = e
d.v = f
d.p = k
j.q = k
j.y = e
j.r = e
j.w = e
j.u = e
j.z = m
j.p = g
j.o = d
i.s = j
k.v = f
k.q = m
k.u = m
k.r = d
c.z = i
c.r = l
e.s = j
f.z = e
f.r = l
assert m.u.z.s.p.txt == "g"