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

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

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

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

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

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

e = A("e")
h = B("h")
k = C("k")
j = D("j")
d = E("d")
g = F("g")
f = F("f")
b = B("b")

e.s = f
h.o = d
h.v = d
h.z = e
k.x = e
j.u = k
d.p = g
d.w = k
g.u = f
g.w = d
g.x = k
f.u = g
f.w = d
f.x = k
b.o = d
b.v = d
b.z = e
assert f.u.x.x.txt == "
class A:
    def __init__(self, txt: str):
        self.s: F = None
        self.txt = txt

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

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

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

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

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

e = A("e")
h = B("h")
k = C("k")
j = D("j")
d = E("d")
g = F("g")
f = F("f")
b = B("b")

e.s = f
h.o = d
h.v = d
h.z = e
k.x = e
j.u = k
d.p = g
d.w = k
g.u = f
g.w = d
g.x = k
f.u = g
f.w = d
f.x = k
b.o = d
b.v = d
b.z = e
assert f.u.x.x.txt == "e"