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

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: F = None
        self.z: D = None
        self.w: B = None
        self.v: A = None
        self.q: A = None
        self.y: C = None
        self.txt = txt

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

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

f.u = a
e.w = j
i.t = d
i.u = f
k.x = j
k.q = h
k.s = e
h.p = d
h.z = k
h.w = e
h.v = f
h.q = f
h.y = i
j.q = d
d.q = j
a.p = d
a.z = k
a.w = e
a.v = f
a.q = f
a.y = i
assert f.u.v.u.txt == "
class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: F = None
        self.z: D = None
        self.w: B = None
        self.v: A = None
        self.q: A = None
        self.y: C = None
        self.txt = txt

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

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

f.u = a
e.w = j
i.t = d
i.u = f
k.x = j
k.q = h
k.s = e
h.p = d
h.z = k
h.w = e
h.v = f
h.q = f
h.y = i
j.q = d
d.q = j
a.p = d
a.z = k
a.w = e
a.v = f
a.q = f
a.y = i
assert f.u.v.u.txt == "a"