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

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

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

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

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

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

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

k.p = n
k.s = n
c.r = n
c.o = n
c.q = d
c.x = j
c.y = a
h.z = c
h.p = f
h.w = k
h.y = g
d.z = a
d.r = j
d.o = j
d.q = k
j.y = n
j.w = h
n.q = j
n.o = j
n.w = j
n.x = j
n.z = g
n.y = d
g.q = j
g.o = j
g.w = j
g.x = j
g.z = n
g.y = d
a.r = g
a.q = d
a.o = n
a.x = j
a.y = c
f.z = a
f.p = h
f.w = k
f.y = g
assert h.y.y.r.w.w.s.z.q.txt == "
class A:
    def __init__(self, txt: str):
        self.p: F = None
        self.s: F = None
        self.txt = txt

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

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

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

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

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

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

k.p = n
k.s = n
c.r = n
c.o = n
c.q = d
c.x = j
c.y = a
h.z = c
h.p = f
h.w = k
h.y = g
d.z = a
d.r = j
d.o = j
d.q = k
j.y = n
j.w = h
n.q = j
n.o = j
n.w = j
n.x = j
n.z = g
n.y = d
g.q = j
g.o = j
g.w = j
g.x = j
g.z = n
g.y = d
a.r = g
a.q = d
a.o = n
a.x = j
a.y = c
f.z = a
f.p = h
f.w = k
f.y = g
assert h.y.y.r.w.w.s.z.q.txt == "j"