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

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

class C:
    def __init__(self, txt: str):
        self.s: B = None
        self.z: A = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.s: B = None
        self.z: A = None
        self.txt = txt

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

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

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

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

n.r = l
n.y = i
n.q = f
l.o = j
l.w = j
l.u = n
l.q = i
l.t = m
j.s = l
j.z = f
e.w = f
e.p = i
e.x = m
i.o = e
i.t = l
m.y = n
f.r = l
f.y = i
f.q = n
h.s = l
h.z = n
assert i.o.w.q.q.r.o.s.txt == "l"