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

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

class C:
    def __init__(self, txt: str):
        self.w: B = None
        self.s: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: A = None
        self.z: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: E = None
        self.s: D = None
        self.u: E = None
        self.r: D = None
        self.z: E = None
        self.p: C = None
        self.y: F = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: F = None
        self.o: B = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: B = None
        self.s: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: A = None
        self.z: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: E = None
        self.s: D = None
        self.u: E = None
        self.r: D = None
        self.z: E = None
        self.p: C = None
        self.y: F = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: F = None
        self.o: B = None
        self.txt = txt

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

l.o = b
l.x = b
l.y = n
l.p = i
l.z = i
n.x = c
g.w = n
g.s = h
m.p = h
k.u = l
k.z = h
a.w = k
a.u = k
a.z = k
a.s = m
a.r = m
a.p = g
a.y = c
h.s = a
h.o = i
i.x = a
c.w = k
c.u = k
c.z = k
c.s = b
c.r = m
c.p = g
c.y = a
b.p = h
assert i.x.p.s.o.x.txt == "a"