class A:
    def __init__(self, txt: str):
        self.r: F = None
        self.y: F = None
        self.p: D = None
        self.v: D = None
        self.t: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: C = None
        self.t: C = None
        self.w: B = None
        self.s: D = None
        self.p: E = None
        self.txt = txt

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

n = A("n")
l = B("l")
f = C("f")
c = D("c")
j = E("j")
e = F("e")
k = E("k")

n.r = e
n.y = e
n.p = c
n.v = c
n.t = f
l.q = n
l.r = f
l.s = f
l.p = k
f.r = n
f.u = n
f.z = l
f.t = j
f.y = j
f.q = c
c.t = e
j.y = f
j.t = f
j.w = l
j.s = c
j.p = k
e.o = c
e.r = f
e.q = j
e.y = j
e.w = k
k.y = f
k.t = f
k.w = l
k.s = c
k.p = j
assert k.y.z.p.s.txt == "
class A:
    def __init__(self, txt: str):
        self.r: F = None
        self.y: F = None
        self.p: D = None
        self.v: D = None
        self.t: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: C = None
        self.t: C = None
        self.w: B = None
        self.s: D = None
        self.p: E = None
        self.txt = txt

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

n = A("n")
l = B("l")
f = C("f")
c = D("c")
j = E("j")
e = F("e")
k = E("k")

n.r = e
n.y = e
n.p = c
n.v = c
n.t = f
l.q = n
l.r = f
l.s = f
l.p = k
f.r = n
f.u = n
f.z = l
f.t = j
f.y = j
f.q = c
c.t = e
j.y = f
j.t = f
j.w = l
j.s = c
j.p = k
e.o = c
e.r = f
e.q = j
e.y = j
e.w = k
k.y = f
k.t = f
k.w = l
k.s = c
k.p = j
assert k.y.z.p.s.txt == "c"