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

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

class C:
    def __init__(self, txt: str):
        self.q: E = None
        self.r: G = None
        self.t: H = None
        self.v: F = None
        self.p: B = None
        self.s: D = None
        self.u: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: D = None
        self.p: D = None
        self.o: H = None
        self.x: C = None
        self.u: G = None
        self.z: C = None
        self.w: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: G = None
        self.z: B = None
        self.s: D = None
        self.x: G = None
        self.w: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: H = None
        self.p: F = None
        self.w: E = None
        self.r: E = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.q: E = None
        self.r: G = None
        self.t: H = None
        self.v: F = None
        self.p: B = None
        self.s: D = None
        self.u: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: D = None
        self.p: D = None
        self.o: H = None
        self.x: C = None
        self.u: G = None
        self.z: C = None
        self.w: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: G = None
        self.z: B = None
        self.s: D = None
        self.x: G = None
        self.w: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: H = None
        self.p: F = None
        self.w: E = None
        self.r: E = None
        self.txt = txt

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

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

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