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

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

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

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

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

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

f = A("f")
g = B("g")
n = C("n")
l = D("l")
d = E("d")
m = F("m")
h = F("h")
i = C("i")
k = D("k")
j = E("j")

f.s = g
f.t = m
f.u = h
g.t = h
g.v = d
g.s = d
g.p = n
g.y = n
n.q = d
n.p = f
n.s = j
n.o = l
n.t = k
l.q = j
l.s = g
l.p = k
d.w = g
d.u = g
d.s = i
d.r = j
d.y = h
d.x = f
m.u = h
h.u = m
i.q = d
i.s = d
i.p = f
i.o = l
i.t = k
k.q = d
k.s = g
k.p = l
j.w = g
j.u = g
j.s = i
j.r = d
j.y = m
j.x = f
assert n.s.s.o.p.q.txt == "
class A:
    def __init__(self, txt: str):
        self.s: B = None
        self.t: F = None
        self.u: F = None
        self.txt = txt

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

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

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

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

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

f = A("f")
g = B("g")
n = C("n")
l = D("l")
d = E("d")
m = F("m")
h = F("h")
i = C("i")
k = D("k")
j = E("j")

f.s = g
f.t = m
f.u = h
g.t = h
g.v = d
g.s = d
g.p = n
g.y = n
n.q = d
n.p = f
n.s = j
n.o = l
n.t = k
l.q = j
l.s = g
l.p = k
d.w = g
d.u = g
d.s = i
d.r = j
d.y = h
d.x = f
m.u = h
h.u = m
i.q = d
i.s = d
i.p = f
i.o = l
i.t = k
k.q = d
k.s = g
k.p = l
j.w = g
j.u = g
j.s = i
j.r = d
j.y = m
j.x = f
assert n.s.s.o.p.q.txt == "d"