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

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.o: G = None
        self.t: B = None
        self.u: C = None
        self.q: G = None
        self.y: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.s: B = None
        self.t: A = None
        self.x: H = None
        self.o: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: D = None
        self.s: B = None
        self.t: A = None
        self.r: E = None
        self.p: E = None
        self.w: B = None
        self.y: D = None
        self.x: G = None
        self.txt = txt

g = A("g")
e = B("e")
k = C("k")
l = D("l")
h = E("h")
a = F("a")
d = G("d")
n = H("n")

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.o: G = None
        self.t: B = None
        self.u: C = None
        self.q: G = None
        self.y: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.s: B = None
        self.t: A = None
        self.x: H = None
        self.o: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: D = None
        self.s: B = None
        self.t: A = None
        self.r: E = None
        self.p: E = None
        self.w: B = None
        self.y: D = None
        self.x: G = None
        self.txt = txt

g = A("g")
e = B("e")
k = C("k")
l = D("l")
h = E("h")
a = F("a")
d = G("d")
n = H("n")

g.w = l
e.t = l
e.r = l
k.u = l
l.x = d
h.r = a
h.o = d
h.q = d
h.t = e
h.u = k
h.y = k
a.w = h
d.s = e
d.t = g
d.x = n
d.o = a
n.o = l
n.y = l
n.s = e
n.w = e
n.t = g
n.r = h
n.p = h
n.x = d
assert k.u.x.t.w.x.txt == "d"