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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.s: C = None
        self.z: E = None
        self.u: D = None
        self.t: A = None
        self.w: D = None
        self.y: D = None
        self.txt = txt

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

j.u = c
j.q = c
h.q = a
h.u = g
h.s = b
h.v = e
a.z = d
g.q = j
g.o = a
d.t = m
d.v = m
d.p = b
d.q = h
n.s = a
n.z = d
n.u = g
n.w = g
n.y = g
n.t = j
m.s = a
m.z = d
m.u = g
m.w = g
m.y = g
m.t = j
b.z = d
c.s = a
c.z = d
c.u = g
c.w = g
c.y = g
c.t = j
e.q = a
e.s = a
e.u = g
e.v = h
assert h.v.s.z.v.y.q.txt == "
class A:
    def __init__(self, txt: str):
        self.u: F = None
        self.q: F = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.s: C = None
        self.z: E = None
        self.u: D = None
        self.t: A = None
        self.w: D = None
        self.y: D = None
        self.txt = txt

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

j.u = c
j.q = c
h.q = a
h.u = g
h.s = b
h.v = e
a.z = d
g.q = j
g.o = a
d.t = m
d.v = m
d.p = b
d.q = h
n.s = a
n.z = d
n.u = g
n.w = g
n.y = g
n.t = j
m.s = a
m.z = d
m.u = g
m.w = g
m.y = g
m.t = j
b.z = d
c.s = a
c.z = d
c.u = g
c.w = g
c.y = g
c.t = j
e.q = a
e.s = a
e.u = g
e.v = h
assert h.v.s.z.v.y.q.txt == "j"