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

class B:
    def __init__(self, txt: str):
        self.p: D = None
        self.q: D = None
        self.o: C = None
        self.r: H = None
        self.x: A = None
        self.s: H = None
        self.u: D = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.z: C = None
        self.u: E = None
        self.q: B = None
        self.o: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: A = None
        self.o: D = None
        self.r: D = None
        self.p: A = None
        self.y: C = None
        self.v: A = None
        self.q: B = None
        self.txt = txt

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

a = A("a")
b = B("b")
l = C("l")
d = D("d")
g = E("g")
k = F("k")
i = G("i")
j = H("j")
f = F("f")

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

class B:
    def __init__(self, txt: str):
        self.p: D = None
        self.q: D = None
        self.o: C = None
        self.r: H = None
        self.x: A = None
        self.s: H = None
        self.u: D = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.z: C = None
        self.u: E = None
        self.q: B = None
        self.o: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: A = None
        self.o: D = None
        self.r: D = None
        self.p: A = None
        self.y: C = None
        self.v: A = None
        self.q: B = None
        self.txt = txt

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

a = A("a")
b = B("b")
l = C("l")
d = D("d")
g = E("g")
k = F("k")
i = G("i")
j = H("j")
f = F("f")

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