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

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

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

class D:
    def __init__(self, txt: str):
        self.s: E = None
        self.u: H = None
        self.o: H = None
        self.z: A = None
        self.p: F = None
        self.r: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: F = None
        self.r: C = None
        self.w: C = None
        self.s: G = None
        self.y: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.z: C = None
        self.o: H = None
        self.u: G = None
        self.w: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: A = None
        self.q: A = None
        self.r: B = None
        self.t: A = None
        self.o: A = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.s: E = None
        self.u: H = None
        self.o: H = None
        self.z: A = None
        self.p: F = None
        self.r: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: F = None
        self.r: C = None
        self.w: C = None
        self.s: G = None
        self.y: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.z: C = None
        self.o: H = None
        self.u: G = None
        self.w: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: A = None
        self.q: A = None
        self.r: B = None
        self.t: A = None
        self.o: A = None
        self.txt = txt

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

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