class A:
    def __init__(self, txt: str):
        self.o: F = None
        self.u: E = None
        self.x: D = None
        self.y: B = None
        self.txt = txt

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

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

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

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

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

f = A("f")
l = B("l")
m = C("m")
a = D("a")
d = E("d")
g = F("g")
k = B("k")

f.o = g
f.u = d
f.x = a
f.y = l
l.p = d
l.v = d
m.x = k
m.q = d
a.r = g
a.p = g
a.z = k
d.t = k
d.r = k
d.x = m
d.o = f
d.w = g
d.y = l
g.u = a
g.z = m
g.p = f
g.s = k
k.p = d
k.v = d
assert k.p.t.v.o.y.p.x.txt == "
class A:
    def __init__(self, txt: str):
        self.o: F = None
        self.u: E = None
        self.x: D = None
        self.y: B = None
        self.txt = txt

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

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

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

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

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

f = A("f")
l = B("l")
m = C("m")
a = D("a")
d = E("d")
g = F("g")
k = B("k")

f.o = g
f.u = d
f.x = a
f.y = l
l.p = d
l.v = d
m.x = k
m.q = d
a.r = g
a.p = g
a.z = k
d.t = k
d.r = k
d.x = m
d.o = f
d.w = g
d.y = l
g.u = a
g.z = m
g.p = f
g.s = k
k.p = d
k.v = d
assert k.p.t.v.o.y.p.x.txt == "m"