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

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

class C:
    def __init__(self, txt: str):
        self.o: H = None
        self.w: G = None
        self.p: G = None
        self.u: H = None
        self.v: E = None
        self.t: G = None
        self.y: F = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.t: H = None
        self.x: H = None
        self.w: E = None
        self.y: H = None
        self.z: H = None
        self.r: D = None
        self.p: E = None
        self.s: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: A = None
        self.x: I = None
        self.q: G = None
        self.t: A = None
        self.z: D = None
        self.y: F = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.o: H = None
        self.w: G = None
        self.p: G = None
        self.u: H = None
        self.v: E = None
        self.t: G = None
        self.y: F = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.t: H = None
        self.x: H = None
        self.w: E = None
        self.y: H = None
        self.z: H = None
        self.r: D = None
        self.p: E = None
        self.s: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: A = None
        self.x: I = None
        self.q: G = None
        self.t: A = None
        self.z: D = None
        self.y: F = None
        self.txt = txt

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

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

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