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

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

class C:
    def __init__(self, txt: str):
        self.r: F = None
        self.o: E = None
        self.v: F = None
        self.s: E = None
        self.q: F = None
        self.w: A = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.r: F = None
        self.o: E = None
        self.v: F = None
        self.s: E = None
        self.q: F = None
        self.w: A = None
        self.txt = txt

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

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

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

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

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