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

class B:
    def __init__(self, txt: str):
        self.u: G = None
        self.x: A = None
        self.z: A = None
        self.w: G = None
        self.t: D = None
        self.s: D = None
        self.p: H = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.x: E = None
        self.w: C = None
        self.u: D = None
        self.q: H = None
        self.o: H = None
        self.s: A = None
        self.t: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.r: E = None
        self.w: B = None
        self.o: G = None
        self.txt = txt

k = A("k")
a = B("a")
j = C("j")
g = D("g")
f = E("f")
b = F("b")
i = G("i")
n = H("n")
h = D("h")

k.t = n
k.q = j
a.u = i
a.w = i
a.x = k
a.z = k
a.t = g
a.s = h
a.p = n
j.r = b
g.q = f
g.s = f
g.w = n
g.x = k
g.o = b
g.p = b
f.u = b
f.q = i
b.x = f
b.w = j
b.u = h
b.q = n
b.o = n
b.s = k
b.t = k
i.y = a
i.z = f
i.t = j
n.r = f
n.w = a
n.o = i
h.q = f
h.s = f
h.w = n
h.x = k
h.o = b
h.p = b
assert a.u.t.r.w.txt == "
class A:
    def __init__(self, txt: str):
        self.t: H = None
        self.q: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: G = None
        self.x: A = None
        self.z: A = None
        self.w: G = None
        self.t: D = None
        self.s: D = None
        self.p: H = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.x: E = None
        self.w: C = None
        self.u: D = None
        self.q: H = None
        self.o: H = None
        self.s: A = None
        self.t: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.r: E = None
        self.w: B = None
        self.o: G = None
        self.txt = txt

k = A("k")
a = B("a")
j = C("j")
g = D("g")
f = E("f")
b = F("b")
i = G("i")
n = H("n")
h = D("h")

k.t = n
k.q = j
a.u = i
a.w = i
a.x = k
a.z = k
a.t = g
a.s = h
a.p = n
j.r = b
g.q = f
g.s = f
g.w = n
g.x = k
g.o = b
g.p = b
f.u = b
f.q = i
b.x = f
b.w = j
b.u = h
b.q = n
b.o = n
b.s = k
b.t = k
i.y = a
i.z = f
i.t = j
n.r = f
n.w = a
n.o = i
h.q = f
h.s = f
h.w = n
h.x = k
h.o = b
h.p = b
assert a.u.t.r.w.txt == "j"