class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.txt = txt

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

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

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

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

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

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

n.w = l
i.x = n
l.x = j
a.u = i
m.q = n
m.s = i
m.v = i
m.x = a
m.t = d
h.t = d
h.x = i
e.u = i
d.q = n
d.s = i
d.v = i
d.x = a
d.t = c
j.q = n
j.s = i
j.v = i
j.x = a
j.t = m
c.q = n
c.s = i
c.v = i
c.x = a
c.t = d
assert a.u.x.w.x.q.w.x.txt == "
class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.txt = txt

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

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

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

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

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

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

n.w = l
i.x = n
l.x = j
a.u = i
m.q = n
m.s = i
m.v = i
m.x = a
m.t = d
h.t = d
h.x = i
e.u = i
d.q = n
d.s = i
d.v = i
d.x = a
d.t = c
j.q = n
j.s = i
j.v = i
j.x = a
j.t = m
c.q = n
c.s = i
c.v = i
c.x = a
c.t = d
assert a.u.x.w.x.q.w.x.txt == "j"