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

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.txt = txt

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

a = A("a")
b = B("b")
i = C("i")
n = D("n")
d = E("d")
c = F("c")
l = D("l")

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.txt = txt

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

a = A("a")
b = B("b")
i = C("i")
n = D("n")
d = E("d")
c = F("c")
l = D("l")

a.o = b
a.r = b
a.x = c
a.p = d
b.u = c
b.t = a
i.p = n
i.r = c
i.t = b
n.s = l
n.y = a
d.u = b
c.w = b
c.u = b
c.v = i
l.s = n
l.y = a
assert l.y.p.u.t.r.u.txt == "c"