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

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

class C:
    def __init__(self, txt: str):
        self.r: F = None
        self.u: F = None
        self.o: E = None
        self.p: D = None
        self.txt = txt

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

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

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

b = A("b")
c = B("c")
i = C("i")
j = D("j")
f = E("f")
n = F("n")
a = F("a")
e = C("e")

b.s = a
c.w = f
c.s = f
c.t = a
c.x = j
c.o = b
c.z = n
i.r = n
i.u = a
i.o = f
i.p = j
j.o = f
f.w = i
n.r = a
n.x = f
n.w = j
a.r = n
a.x = f
a.w = j
e.r = a
e.u = a
e.o = f
e.p = j
assert f.w.u.r.x.w.u.x.txt == "
class A:
    def __init__(self, txt: str):
        self.s: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: F = None
        self.u: F = None
        self.o: E = None
        self.p: D = None
        self.txt = txt

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

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

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

b = A("b")
c = B("c")
i = C("i")
j = D("j")
f = E("f")
n = F("n")
a = F("a")
e = C("e")

b.s = a
c.w = f
c.s = f
c.t = a
c.x = j
c.o = b
c.z = n
i.r = n
i.u = a
i.o = f
i.p = j
j.o = f
f.w = i
n.r = a
n.x = f
n.w = j
a.r = n
a.x = f
a.w = j
e.r = a
e.u = a
e.o = f
e.p = j
assert f.w.u.r.x.w.u.x.txt == "f"