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

class B:
    def __init__(self, txt: str):
        self.x: A = None
        self.s: H = None
        self.t: D = None
        self.u: H = None
        self.p: G = None
        self.z: E = None
        self.w: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: G = None
        self.x: F = None
        self.r: E = None
        self.w: A = None
        self.v: A = None
        self.t: F = None
        self.s: A = None
        self.p: D = 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.v: C = None
        self.o: D = None
        self.t: G = None
        self.r: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: A = None
        self.q: E = None
        self.o: E = None
        self.x: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: A = None
        self.s: B = None
        self.r: B = None
        self.y: D = None
        self.p: B = None
        self.w: D = None
        self.t: A = None
        self.txt = txt

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

d.s = i
d.x = c
d.z = c
d.t = j
d.v = b
b.x = d
b.s = f
b.u = f
b.t = c
b.p = j
b.z = m
b.w = m
i.z = j
i.x = h
i.t = h
i.r = m
i.w = d
i.v = d
i.s = d
i.p = c
c.q = h
m.v = i
m.o = c
m.t = j
m.r = j
h.q = d
h.x = f
j.t = d
j.q = m
j.o = m
j.x = h
f.x = d
f.t = d
f.s = b
f.r = b
f.p = b
f.y = c
f.w = c
assert d.x.q.x.y.q.x.y.txt == "
class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.x: D = None
        self.z: D = None
        self.t: G = None
        self.v: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: A = None
        self.s: H = None
        self.t: D = None
        self.u: H = None
        self.p: G = None
        self.z: E = None
        self.w: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: G = None
        self.x: F = None
        self.r: E = None
        self.w: A = None
        self.v: A = None
        self.t: F = None
        self.s: A = None
        self.p: D = 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.v: C = None
        self.o: D = None
        self.t: G = None
        self.r: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: A = None
        self.q: E = None
        self.o: E = None
        self.x: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: A = None
        self.s: B = None
        self.r: B = None
        self.y: D = None
        self.p: B = None
        self.w: D = None
        self.t: A = None
        self.txt = txt

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

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