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

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

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.y: D = None
        self.o: A = None
        self.txt = txt

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

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

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

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

f.o = c
f.y = i
f.p = n
f.s = j
f.w = j
f.q = k
i.p = b
i.x = a
a.p = k
a.y = j
a.o = f
j.q = b
j.r = a
j.x = a
b.w = i
c.u = j
n.w = i
k.o = c
k.y = i
k.p = b
k.s = j
k.w = j
k.q = f
assert k.q.y.x.y.txt == "
class A:
    def __init__(self, txt: str):
        self.o: F = None
        self.y: B = None
        self.p: E = None
        self.s: D = None
        self.w: D = None
        self.q: A = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.y: D = None
        self.o: A = None
        self.txt = txt

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

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

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

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

f.o = c
f.y = i
f.p = n
f.s = j
f.w = j
f.q = k
i.p = b
i.x = a
a.p = k
a.y = j
a.o = f
j.q = b
j.r = a
j.x = a
b.w = i
c.u = j
n.w = i
k.o = c
k.y = i
k.p = b
k.s = j
k.w = j
k.q = f
assert k.q.y.x.y.txt == "j"