class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: F = None
        self.v: E = None
        self.r: C = None
        self.z: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: D = None
        self.t: E = None
        self.o: F = None
        self.z: F = None
        self.w: D = None
        self.s: A = None
        self.txt = txt

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

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

d = A("d")
n = B("n")
c = C("c")
h = D("h")
a = E("a")
l = F("l")
k = E("k")
g = D("g")

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

class B:
    def __init__(self, txt: str):
        self.y: F = None
        self.v: E = None
        self.r: C = None
        self.z: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: D = None
        self.t: E = None
        self.o: F = None
        self.z: F = None
        self.w: D = None
        self.s: A = None
        self.txt = txt

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

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

d = A("d")
n = B("n")
c = C("c")
h = D("h")
a = E("a")
l = F("l")
k = E("k")
g = D("g")

d.q = c
n.y = l
n.z = l
n.v = a
n.r = c
c.x = n
c.o = n
h.u = g
h.w = g
h.t = a
h.o = l
h.z = l
h.s = d
a.r = d
l.y = a
l.w = k
k.r = d
g.u = h
g.w = h
g.t = k
g.o = l
g.z = l
g.s = d
assert c.o.v.r.q.o.txt == "n"