class A:
    def __init__(self, txt: str):
        self.o: D = None
        self.w: F = None
        self.z: F = None
        self.v: B = None
        self.u: F = None
        self.x: F = None
        self.r: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: G = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.q: C = None
        self.z: C = None
        self.v: F = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.v: G = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.q: C = None
        self.z: C = None
        self.v: F = None
        self.txt = txt

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

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