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

class B:
    def __init__(self, txt: str):
        self.v: E = None
        self.q: D = None
        self.p: H = None
        self.o: 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.r: C = None
        self.x: F = None
        self.w: E = None
        self.o: E = None
        self.t: C = None
        self.p: B = None
        self.y: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: A = None
        self.y: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: B = None
        self.x: G = None
        self.u: B = None
        self.txt = txt

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

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

n = A("n")
m = B("m")
e = C("e")
j = D("j")
l = E("l")
k = F("k")
b = G("b")
f = H("f")
c = G("c")
g = A("g")

n.w = e
n.x = b
n.s = f
m.v = l
m.q = j
m.p = f
m.o = f
e.r = k
j.r = e
j.t = e
j.x = k
j.w = l
j.o = l
j.p = m
j.y = m
l.r = n
l.y = k
k.y = m
k.u = m
k.x = c
b.t = n
b.x = c
b.q = c
f.o = l
f.w = j
c.t = n
c.x = b
c.q = b
g.w = e
g.x = c
g.s = f
assert e.r.u.v.r.w.r.x.t.txt == "
class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.x: G = None
        self.s: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: E = None
        self.q: D = None
        self.p: H = None
        self.o: 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.r: C = None
        self.x: F = None
        self.w: E = None
        self.o: E = None
        self.t: C = None
        self.p: B = None
        self.y: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: A = None
        self.y: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: B = None
        self.x: G = None
        self.u: B = None
        self.txt = txt

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

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

n = A("n")
m = B("m")
e = C("e")
j = D("j")
l = E("l")
k = F("k")
b = G("b")
f = H("f")
c = G("c")
g = A("g")

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