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

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

class C:
    def __init__(self, txt: str):
        self.u: E = None
        self.q: A = None
        self.p: E = None
        self.z: B = None
        self.txt = txt

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

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

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

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

h.w = k
h.x = k
h.s = j
c.s = b
c.p = k
c.r = n
j.u = b
j.p = b
j.q = h
j.z = c
k.w = n
k.q = c
b.t = g
b.s = m
b.p = k
b.x = k
b.o = h
d.t = j
d.v = g
d.w = f
d.o = m
d.x = k
f.w = k
f.x = k
f.s = j
n.s = b
n.p = k
n.r = c
g.w = k
g.x = k
g.s = j
m.t = j
m.v = f
m.w = g
m.o = d
m.x = k
assert d.v.s.q.s.u.o.s.q.txt == "
class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.x: D = None
        self.s: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: E = None
        self.q: A = None
        self.p: E = None
        self.z: B = None
        self.txt = txt

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

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

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

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

h.w = k
h.x = k
h.s = j
c.s = b
c.p = k
c.r = n
j.u = b
j.p = b
j.q = h
j.z = c
k.w = n
k.q = c
b.t = g
b.s = m
b.p = k
b.x = k
b.o = h
d.t = j
d.v = g
d.w = f
d.o = m
d.x = k
f.w = k
f.x = k
f.s = j
n.s = b
n.p = k
n.r = c
g.w = k
g.x = k
g.s = j
m.t = j
m.v = f
m.w = g
m.o = d
m.x = k
assert d.v.s.q.s.u.o.s.q.txt == "h"