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

class B:
    def __init__(self, txt: str):
        self.y: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.x: H = None
        self.s: H = None
        self.v: G = None
        self.t: B = None
        self.p: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.y: G = None
        self.z: G = None
        self.t: F = None
        self.w: H = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.y: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.x: H = None
        self.s: H = None
        self.v: G = None
        self.t: B = None
        self.p: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.y: G = None
        self.z: G = None
        self.t: F = None
        self.w: H = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

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

g.w = n
g.s = d
g.x = m
d.y = n
k.y = m
k.x = n
k.s = n
k.v = l
k.t = d
k.p = c
m.u = d
m.y = l
m.z = l
m.t = c
m.w = n
a.y = m
a.s = m
a.x = g
a.o = g
c.x = g
c.w = a
c.o = n
c.q = l
c.r = l
l.z = n
l.u = a
n.v = d
assert k.p.r.z.v.y.v.txt == "d"