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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.q: F = None
        self.r: F = None
        self.s: H = None
        self.w: C = None
        self.o: C = None
        self.u: H = None
        self.y: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: B = None
        self.y: C = None
        self.txt = txt

g = A("g")
a = B("a")
h = C("h")
m = D("m")
f = E("f")
d = F("d")
i = G("i")
b = H("b")

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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.q: F = None
        self.r: F = None
        self.s: H = None
        self.w: C = None
        self.o: C = None
        self.u: H = None
        self.y: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: B = None
        self.y: C = None
        self.txt = txt

g = A("g")
a = B("a")
h = C("h")
m = D("m")
f = E("f")
d = F("d")
i = G("i")
b = H("b")

g.o = f
a.q = m
a.r = g
h.y = d
h.z = g
h.s = m
h.x = i
m.q = d
f.z = i
d.r = b
d.s = b
d.p = b
d.q = a
d.w = g
d.v = g
d.x = i
d.t = f
i.q = d
i.r = d
i.y = d
i.s = b
i.u = b
i.w = h
i.o = h
b.u = a
b.y = h
assert b.y.y.x.s.u.q.q.r.txt == "b"