class A:
    def __init__(self, txt: str):
        self.w: E = None
        self.p: B = None
        self.u: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: H = None
        self.u: E = None
        self.y: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: C = None
        self.x: A = None
        self.p: E = None
        self.u: G = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: B = None
        self.y: B = None
        self.txt = txt

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

i.w = a
i.p = k
i.u = d
k.p = h
k.u = a
k.y = a
g.y = i
g.w = i
g.p = i
g.q = m
g.r = f
g.o = d
g.z = k
g.u = k
f.y = g
f.x = i
f.p = a
f.u = m
a.o = f
d.y = g
d.w = g
m.x = g
h.x = k
h.y = k
c.x = g
assert d.y.r.y.p.p.txt == "
class A:
    def __init__(self, txt: str):
        self.w: E = None
        self.p: B = None
        self.u: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: H = None
        self.u: E = None
        self.y: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: C = None
        self.x: A = None
        self.p: E = None
        self.u: G = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: B = None
        self.y: B = None
        self.txt = txt

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

i.w = a
i.p = k
i.u = d
k.p = h
k.u = a
k.y = a
g.y = i
g.w = i
g.p = i
g.q = m
g.r = f
g.o = d
g.z = k
g.u = k
f.y = g
f.x = i
f.p = a
f.u = m
a.o = f
d.y = g
d.w = g
m.x = g
h.x = k
h.y = k
c.x = g
assert d.y.r.y.p.p.txt == "k"