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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: D = None
        self.t: E = None
        self.w: C = None
        self.y: D = None
        self.txt = txt

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

j.w = e
j.p = e
j.s = a
j.y = i
f.r = e
f.x = i
f.s = j
f.w = k
f.y = m
a.w = m
a.q = m
a.u = i
k.x = f
k.u = i
k.o = a
i.u = k
i.q = e
e.q = k
e.y = k
e.t = i
e.w = a
m.w = e
m.p = e
m.s = a
m.y = i
assert a.u.u.u.txt == "
class A:
    def __init__(self, txt: str):
        self.w: F = None
        self.s: C = None
        self.y: E = None
        self.p: F = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: D = None
        self.t: E = None
        self.w: C = None
        self.y: D = None
        self.txt = txt

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

j.w = e
j.p = e
j.s = a
j.y = i
f.r = e
f.x = i
f.s = j
f.w = k
f.y = m
a.w = m
a.q = m
a.u = i
k.x = f
k.u = i
k.o = a
i.u = k
i.q = e
e.q = k
e.y = k
e.t = i
e.w = a
m.w = e
m.p = e
m.s = a
m.y = i
assert a.u.u.u.txt == "i"