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

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: C = None
        self.w: F = None
        self.u: G = None
        self.y: B = None
        self.q: A = None
        self.txt = txt

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

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: C = None
        self.w: F = None
        self.u: G = None
        self.y: B = None
        self.q: A = None
        self.txt = txt

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

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

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

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