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

class B:
    def __init__(self, txt: str):
        self.s: D = None
        self.t: G = None
        self.o: A = None
        self.r: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: A = None
        self.x: E = None
        self.u: D = None
        self.v: D = None
        self.p: A = None
        self.q: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: F = None
        self.o: E = None
        self.p: C = None
        self.s: F = None
        self.r: C = None
        self.q: G = None
        self.z: G = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.q: C = None
        self.z: D = None
        self.u: C = None
        self.r: F = None
        self.o: E = None
        self.x: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.s: D = None
        self.t: G = None
        self.o: A = None
        self.r: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: A = None
        self.x: E = None
        self.u: D = None
        self.v: D = None
        self.p: A = None
        self.q: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: F = None
        self.o: E = None
        self.p: C = None
        self.s: F = None
        self.r: C = None
        self.q: G = None
        self.z: G = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.q: C = None
        self.z: D = None
        self.u: C = None
        self.r: F = None
        self.o: E = None
        self.x: D = None
        self.txt = txt

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

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