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

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

class C:
    def __init__(self, txt: str):
        self.x: B = None
        self.txt = txt

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

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

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

e = A("e")
n = B("n")
a = C("a")
b = D("b")
j = E("j")
m = F("m")
d = E("d")
f = F("f")
k = A("k")
l = B("l")

e.p = k
e.v = a
e.o = m
n.w = l
n.y = b
n.s = e
n.v = j
a.x = n
b.s = j
j.y = n
m.u = k
d.y = l
f.u = e
k.p = e
k.v = a
k.o = m
l.w = n
l.y = b
l.s = k
l.v = j
assert f.u.o.u.v.x.s.p.v.txt == "
class A:
    def __init__(self, txt: str):
        self.p: A = None
        self.v: C = None
        self.o: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: B = None
        self.txt = txt

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

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

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

e = A("e")
n = B("n")
a = C("a")
b = D("b")
j = E("j")
m = F("m")
d = E("d")
f = F("f")
k = A("k")
l = B("l")

e.p = k
e.v = a
e.o = m
n.w = l
n.y = b
n.s = e
n.v = j
a.x = n
b.s = j
j.y = n
m.u = k
d.y = l
f.u = e
k.p = e
k.v = a
k.o = m
l.w = n
l.y = b
l.s = k
l.v = j
assert f.u.o.u.v.x.s.p.v.txt == "a"