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

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: A = None
        self.u: C = None
        self.w: C = None
        self.t: F = None
        self.p: F = None
        self.r: F = None
        self.txt = txt

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

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

n.y = h
n.r = k
h.r = f
h.w = f
h.s = n
h.q = m
j.o = l
j.p = i
j.y = i
j.v = c
c.t = f
f.o = n
f.u = j
f.w = j
f.t = i
f.p = i
f.r = k
i.o = k
i.y = k
i.v = j
i.p = l
i.q = f
l.r = f
l.w = f
l.s = n
l.q = h
k.o = i
k.y = i
k.v = j
k.p = h
k.q = f
m.r = f
m.w = f
m.s = n
m.q = l
assert k.v.v.t.o.y.w.p.txt == "
class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.r: F = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: A = None
        self.u: C = None
        self.w: C = None
        self.t: F = None
        self.p: F = None
        self.r: F = None
        self.txt = txt

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

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

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