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

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

class C:
    def __init__(self, txt: str):
        self.x: A = None
        self.z: D = None
        self.w: F = None
        self.o: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: F = None
        self.v: B = None
        self.s: A = None
        self.q: C = None
        self.t: B = None
        self.txt = txt

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

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

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

h.s = c
a.y = l
a.s = l
a.u = l
a.x = j
a.r = i
j.x = h
j.z = i
j.w = c
j.o = e
i.w = c
i.v = a
i.t = a
i.s = h
i.q = j
k.x = a
k.u = a
k.t = n
k.s = j
l.x = j
l.q = c
n.x = a
n.u = a
n.t = k
n.s = j
b.x = a
b.u = a
b.t = n
b.s = j
e.s = l
c.x = j
c.q = l
assert n.t.s.w.x.z.t.u.x.w.txt == "
class A:
    def __init__(self, txt: str):
        self.s: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: A = None
        self.z: D = None
        self.w: F = None
        self.o: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: F = None
        self.v: B = None
        self.s: A = None
        self.q: C = None
        self.t: B = None
        self.txt = txt

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

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

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

h.s = c
a.y = l
a.s = l
a.u = l
a.x = j
a.r = i
j.x = h
j.z = i
j.w = c
j.o = e
i.w = c
i.v = a
i.t = a
i.s = h
i.q = j
k.x = a
k.u = a
k.t = n
k.s = j
l.x = j
l.q = c
n.x = a
n.u = a
n.t = k
n.s = j
b.x = a
b.u = a
b.t = n
b.s = j
e.s = l
c.x = j
c.q = l
assert n.t.s.w.x.z.t.u.x.w.txt == "c"