class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.t: G = None
        self.r: F = None
        self.y: I = None
        self.v: B = None
        self.x: D = None
        self.q: C = None
        self.s: B = None
        self.w: I = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: I = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: B = None
        self.z: H = None
        self.v: E = None
        self.q: I = None
        self.x: A = None
        self.s: E = None
        self.p: C = None
        self.y: H = None
        self.o: G = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.o: I = None
        self.r: F = None
        self.x: E = None
        self.p: H = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.t: A = None
        self.p: H = None
        self.y: A = None
        self.o: E = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.q: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.w: I = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: B = None
        self.z: H = None
        self.v: E = None
        self.q: I = None
        self.x: A = None
        self.s: E = None
        self.p: C = None
        self.y: H = None
        self.o: G = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.o: I = None
        self.r: F = None
        self.x: E = None
        self.p: H = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.t: A = None
        self.p: H = None
        self.y: A = None
        self.o: E = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.q: E = None
        self.txt = txt

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

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