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

class B:
    def __init__(self, txt: str):
        self.v: F = None
        self.w: F = None
        self.q: H = None
        self.s: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.q: G = None
        self.u: A = None
        self.y: F = None
        self.p: B = None
        self.v: C = None
        self.w: C = None
        self.t: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: E = None
        self.o: D = None
        self.s: D = None
        self.r: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

g = A("g")
d = B("d")
m = C("m")
e = D("e")
h = E("h")
k = F("k")
j = G("j")
c = H("c")
n = H("n")

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

class B:
    def __init__(self, txt: str):
        self.v: F = None
        self.w: F = None
        self.q: H = None
        self.s: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.q: G = None
        self.u: A = None
        self.y: F = None
        self.p: B = None
        self.v: C = None
        self.w: C = None
        self.t: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: E = None
        self.o: D = None
        self.s: D = None
        self.r: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

g = A("g")
d = B("d")
m = C("m")
e = D("e")
h = E("h")
k = F("k")
j = G("j")
c = H("c")
n = H("n")

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