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

class B:
    def __init__(self, txt: str):
        self.x: A = None
        self.p: F = None
        self.t: A = None
        self.o: E = None
        self.y: F = None
        self.z: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.t: F = None
        self.z: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: G = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.o: F = None
        self.v: A = None
        self.p: E = None
        self.q: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.x: A = None
        self.p: F = None
        self.t: A = None
        self.o: E = None
        self.y: F = None
        self.z: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.t: F = None
        self.z: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: G = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.o: F = None
        self.v: A = None
        self.p: E = None
        self.q: F = None
        self.txt = txt

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

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