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

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.p: H = None
        self.s: I = None
        self.w: I = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.w: D = None
        self.p: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.y: B = None
        self.x: C = None
        self.v: D = None
        self.u: J = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.w: C = None
        self.u: C = None
        self.x: D = None
        self.s: D = None
        self.o: C = None
        self.z: F = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.u: B = None
        self.w: E = None
        self.t: B = None
        self.o: D = None
        self.s: H = None
        self.v: C = None
        self.y: E = None
        self.r: E = None
        self.x: B = None
        self.q: C = None
        self.txt = txt

a = A("a")
d = B("d")
g = C("g")
i = D("i")
l = E("l")
j = F("j")
h = G("h")
n = H("n")
b = I("b")
m = J("m")

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

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.p: H = None
        self.s: I = None
        self.w: I = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.w: D = None
        self.p: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.y: B = None
        self.x: C = None
        self.v: D = None
        self.u: J = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.w: C = None
        self.u: C = None
        self.x: D = None
        self.s: D = None
        self.o: C = None
        self.z: F = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.u: B = None
        self.w: E = None
        self.t: B = None
        self.o: D = None
        self.s: H = None
        self.v: C = None
        self.y: E = None
        self.r: E = None
        self.x: B = None
        self.q: C = None
        self.txt = txt

a = A("a")
d = B("d")
g = C("g")
i = D("i")
l = E("l")
j = F("j")
h = G("h")
n = H("n")
b = I("b")
m = J("m")

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