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

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.r: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: G = None
        self.v: C = None
        self.w: E = None
        self.o: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: D = None
        self.txt = txt

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

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

g = A("g")
f = B("f")
d = C("d")
i = D("i")
k = E("k")
n = F("n")
m = G("m")

g.w = m
g.y = n
g.s = d
g.z = d
g.p = f
g.x = k
f.t = i
f.r = i
d.v = n
i.p = m
i.v = d
i.w = k
i.o = k
k.x = i
n.t = i
n.u = i
n.p = g
m.u = i
assert i.p.u.p.u.p.u.txt == "
class A:
    def __init__(self, txt: str):
        self.w: G = None
        self.y: F = None
        self.s: C = None
        self.p: B = None
        self.z: C = None
        self.x: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.r: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: G = None
        self.v: C = None
        self.w: E = None
        self.o: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: D = None
        self.txt = txt

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

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

g = A("g")
f = B("f")
d = C("d")
i = D("i")
k = E("k")
n = F("n")
m = G("m")

g.w = m
g.y = n
g.s = d
g.z = d
g.p = f
g.x = k
f.t = i
f.r = i
d.v = n
i.p = m
i.v = d
i.w = k
i.o = k
k.x = i
n.t = i
n.u = i
n.p = g
m.u = i
assert i.p.u.p.u.p.u.txt == "i"