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

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.o: B = None
        self.p: A = None
        self.t: B = None
        self.s: E = None
        self.y: A = None
        self.q: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.x: F = None
        self.y: B = None
        self.v: C = None
        self.t: B = None
        self.p: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: E = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.o: B = None
        self.p: A = None
        self.t: B = None
        self.s: E = None
        self.y: A = None
        self.q: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.x: F = None
        self.y: B = None
        self.v: C = None
        self.t: B = None
        self.p: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: E = None
        self.txt = txt

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

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

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