class A:
    def __init__(self, txt: str):
        self.x: F = None
        self.w: C = None
        self.y: E = None
        self.z: E = None
        self.q: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: G = None
        self.r: D = None
        self.o: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: E = None
        self.x: H = None
        self.r: D = None
        self.o: A = None
        self.p: F = None
        self.txt = txt

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

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.u: G = None
        self.r: D = None
        self.o: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: E = None
        self.x: H = None
        self.r: D = None
        self.o: A = None
        self.p: F = None
        self.txt = txt

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

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

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

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

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

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

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