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

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

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

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

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

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

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

f.x = j
f.o = m
m.s = f
m.v = d
d.o = e
d.v = k
k.w = m
k.o = j
k.x = j
k.t = f
k.v = d
j.o = f
e.z = d
e.w = d
e.y = m
assert e.y.s.o.v.v.txt == "
class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.o: B = None
        self.txt = txt

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

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

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

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

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

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

f.x = j
f.o = m
m.s = f
m.v = d
d.o = e
d.v = k
k.w = m
k.o = j
k.x = j
k.t = f
k.v = d
j.o = f
e.z = d
e.w = d
e.y = m
assert e.y.s.o.v.v.txt == "k"