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

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: C = None
        self.v: D = None
        self.r: G = None
        self.y: C = None
        self.p: B = None
        self.x: C = None
        self.z: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: D = None
        self.p: C = None
        self.t: E = None
        self.x: E = None
        self.s: A = None
        self.z: C = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: C = None
        self.v: D = None
        self.r: G = None
        self.y: C = None
        self.p: B = None
        self.x: C = None
        self.z: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: D = None
        self.p: C = None
        self.t: E = None
        self.x: E = None
        self.s: A = None
        self.z: C = None
        self.txt = txt

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

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