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

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

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

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.r: A = None
        self.u: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: D = None
        self.r: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: D = None
        self.v: B = None
        self.t: A = None
        self.x: A = None
        self.s: A = None
        self.txt = txt

i = A("i")
h = B("h")
m = C("m")
l = D("l")
f = E("f")
a = F("a")

i.o = f
i.q = m
h.u = m
h.s = i
m.p = l
m.o = a
m.w = h
l.p = i
l.r = i
l.u = m
f.p = l
f.r = m
a.u = l
a.v = h
a.t = i
a.x = i
a.s = i
assert l.p.o.r.o.v.u.txt == "
class A:
    def __init__(self, txt: str):
        self.o: E = None
        self.q: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.r: A = None
        self.u: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: D = None
        self.r: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: D = None
        self.v: B = None
        self.t: A = None
        self.x: A = None
        self.s: A = None
        self.txt = txt

i = A("i")
h = B("h")
m = C("m")
l = D("l")
f = E("f")
a = F("a")

i.o = f
i.q = m
h.u = m
h.s = i
m.p = l
m.o = a
m.w = h
l.p = i
l.r = i
l.u = m
f.p = l
f.r = m
a.u = l
a.v = h
a.t = i
a.x = i
a.s = i
assert l.p.o.r.o.v.u.txt == "m"