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

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

class C:
    def __init__(self, txt: str):
        self.t: B = None
        self.y: B = None
        self.o: A = None
        self.p: D = None
        self.q: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: C = None
        self.v: E = None
        self.u: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: C = None
        self.o: C = None
        self.txt = txt

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

c = A("c")
a = B("a")
k = C("k")
i = D("i")
h = E("h")
f = F("f")
g = G("g")

c.s = k
c.t = k
c.w = h
a.x = g
a.w = f
a.s = i
a.v = i
a.r = i
a.z = c
k.t = a
k.y = a
k.q = a
k.o = c
k.p = i
i.r = k
i.u = k
i.v = h
h.x = f
h.p = k
f.p = k
f.o = k
g.y = i
assert k.t.z.t.p.txt == "
class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.t: C = None
        self.w: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: B = None
        self.y: B = None
        self.o: A = None
        self.p: D = None
        self.q: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: C = None
        self.v: E = None
        self.u: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: C = None
        self.o: C = None
        self.txt = txt

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

c = A("c")
a = B("a")
k = C("k")
i = D("i")
h = E("h")
f = F("f")
g = G("g")

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