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

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

class C:
    def __init__(self, txt: str):
        self.t: H = None
        self.w: G = None
        self.v: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: B = None
        self.q: F = None
        self.t: H = None
        self.u: G = None
        self.w: A = None
        self.y: B = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.t: H = None
        self.w: G = None
        self.v: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: B = None
        self.q: F = None
        self.t: H = None
        self.u: G = None
        self.w: A = None
        self.y: B = None
        self.txt = txt

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

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

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

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

b.y = h
b.w = n
b.s = c
a.t = n
a.y = m
j.t = h
j.w = d
j.v = d
m.x = a
m.s = a
m.t = n
c.x = a
c.y = a
c.q = n
c.t = h
c.u = d
c.w = b
n.p = b
d.x = n
h.w = d
h.q = d
h.v = d
h.o = m
h.t = b
h.s = b
h.y = j
assert b.s.u.x.p.w.p.s.w.txt == "b"