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

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

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

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

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

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

n = A("n")
m = B("m")
d = C("d")
g = D("g")
b = E("b")
k = F("k")
a = F("a")

n.v = a
n.q = b
n.r = b
n.p = m
n.t = m
m.t = n
m.p = d
m.y = k
d.y = m
g.w = d
g.x = d
g.o = m
g.v = m
g.p = b
b.v = a
k.x = b
k.s = b
k.o = d
k.q = m
a.x = b
a.s = b
a.o = d
a.q = m
assert a.o.y.y.o.y.y.txt == "
class A:
    def __init__(self, txt: str):
        self.v: F = None
        self.q: E = None
        self.r: E = None
        self.p: B = None
        self.t: B = None
        self.txt = txt

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

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

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

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

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

n = A("n")
m = B("m")
d = C("d")
g = D("g")
b = E("b")
k = F("k")
a = F("a")

n.v = a
n.q = b
n.r = b
n.p = m
n.t = m
m.t = n
m.p = d
m.y = k
d.y = m
g.w = d
g.x = d
g.o = m
g.v = m
g.p = b
b.v = a
k.x = b
k.s = b
k.o = d
k.q = m
a.x = b
a.s = b
a.o = d
a.q = m
assert a.o.y.y.o.y.y.txt == "k"