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

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

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

class D:
    def __init__(self, txt: str):
        self.x: B = None
        self.w: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: D = None
        self.u: A = None
        self.z: F = None
        self.t: A = None
        self.o: E = None
        self.txt = txt

g = A("g")
m = B("m")
c = C("c")
a = D("a")
n = E("n")
i = F("i")
e = B("e")
k = F("k")
d = B("d")
j = A("j")

g.u = c
g.q = e
g.s = k
m.y = k
m.s = e
m.t = a
c.x = d
a.x = d
a.w = i
n.q = j
n.y = k
n.s = a
n.w = c
n.o = e
i.q = a
i.u = g
i.z = k
i.t = j
i.o = n
e.y = k
e.s = d
e.t = a
k.q = a
k.u = j
k.t = j
k.z = i
k.o = n
d.y = i
d.s = m
d.t = a
j.u = c
j.q = m
j.s = i
assert j.u.x.s.s.t.x.y.q.w.q.txt == "
class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.q: B = None
        self.s: F = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.x: B = None
        self.w: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: D = None
        self.u: A = None
        self.z: F = None
        self.t: A = None
        self.o: E = None
        self.txt = txt

g = A("g")
m = B("m")
c = C("c")
a = D("a")
n = E("n")
i = F("i")
e = B("e")
k = F("k")
d = B("d")
j = A("j")

g.u = c
g.q = e
g.s = k
m.y = k
m.s = e
m.t = a
c.x = d
a.x = d
a.w = i
n.q = j
n.y = k
n.s = a
n.w = c
n.o = e
i.q = a
i.u = g
i.z = k
i.t = j
i.o = n
e.y = k
e.s = d
e.t = a
k.q = a
k.u = j
k.t = j
k.z = i
k.o = n
d.y = i
d.s = m
d.t = a
j.u = c
j.q = m
j.s = i
assert j.u.x.s.s.t.x.y.q.w.q.txt == "a"