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

class B:
    def __init__(self, txt: str):
        self.y: G = None
        self.v: G = None
        self.t: A = None
        self.z: E = None
        self.r: D = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: B = None
        self.t: G = None
        self.q: A = None
        self.s: C = None
        self.z: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.r: D = None
        self.u: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.y: G = None
        self.v: G = None
        self.t: A = None
        self.z: E = None
        self.r: D = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: B = None
        self.t: G = None
        self.q: A = None
        self.s: C = None
        self.z: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.r: D = None
        self.u: F = None
        self.txt = txt

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

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