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

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

class C:
    def __init__(self, txt: str):
        self.q: H = None
        self.x: E = None
        self.z: A = None
        self.v: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: C = None
        self.o: H = None
        self.q: B = None
        self.y: H = None
        self.w: C = None
        self.x: B = None
        self.r: G = None
        self.t: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: G = None
        self.t: G = None
        self.w: F = None
        self.v: F = None
        self.x: C = None
        self.z: F = None
        self.q: G = None
        self.r: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.z: H = None
        self.txt = txt

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

b = A("b")
m = B("m")
c = C("c")
j = D("j")
a = E("a")
h = F("h")
d = G("d")
k = H("k")

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

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

class C:
    def __init__(self, txt: str):
        self.q: H = None
        self.x: E = None
        self.z: A = None
        self.v: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: C = None
        self.o: H = None
        self.q: B = None
        self.y: H = None
        self.w: C = None
        self.x: B = None
        self.r: G = None
        self.t: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: G = None
        self.t: G = None
        self.w: F = None
        self.v: F = None
        self.x: C = None
        self.z: F = None
        self.q: G = None
        self.r: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.z: H = None
        self.txt = txt

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

b = A("b")
m = B("m")
c = C("c")
j = D("j")
a = E("a")
h = F("h")
d = G("d")
k = H("k")

b.z = h
m.w = b
c.q = k
c.v = k
c.x = a
c.z = b
j.v = c
j.w = c
j.o = k
j.y = k
j.q = m
j.x = m
j.t = m
j.r = d
a.s = d
a.t = d
a.q = d
a.w = h
a.v = h
a.z = h
a.x = c
a.r = c
h.s = j
d.z = k
k.q = j
assert h.s.o.q.q.w.txt == "b"