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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: E = None
        self.u: C = None
        self.o: B = None
        self.p: A = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: E = None
        self.u: C = None
        self.o: B = None
        self.p: A = None
        self.txt = txt

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

k.p = d
k.y = f
k.x = f
k.u = f
k.v = n
k.s = j
i.u = n
i.r = a
j.u = k
j.v = k
j.o = f
j.q = n
d.q = i
d.y = a
d.r = f
d.t = j
d.x = n
f.o = a
f.q = j
f.s = j
n.v = f
n.u = j
n.o = i
n.p = k
a.p = d
a.y = f
a.x = f
a.u = f
a.v = n
a.s = j
assert k.v.p.s.q.p.y.txt == "f"