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

class B:
    def __init__(self, txt: str):
        self.x: A = None
        self.p: C = None
        self.v: D = None
        self.t: H = None
        self.o: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: F = None
        self.w: D = None
        self.p: E = None
        self.s: H = None
        self.v: A = None
        self.txt = txt

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

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

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

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

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

f = A("f")
i = B("i")
c = C("c")
h = D("h")
m = E("m")
d = F("d")
g = G("g")
l = H("l")
k = F("k")

f.z = g
f.p = h
f.s = k
i.x = f
i.p = c
i.v = h
i.o = h
i.t = l
c.q = d
c.w = h
c.p = m
c.s = l
c.v = f
h.p = d
m.x = i
m.p = f
m.w = f
m.z = c
m.t = c
m.u = g
d.y = i
d.q = f
d.x = l
d.v = c
g.t = f
g.q = h
l.t = f
l.z = g
k.y = i
k.q = f
k.x = l
k.v = c
assert f.p.p.v.w.p.y.v.p.v.txt == "
class A:
    def __init__(self, txt: str):
        self.z: G = None
        self.p: D = None
        self.s: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: A = None
        self.p: C = None
        self.v: D = None
        self.t: H = None
        self.o: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: F = None
        self.w: D = None
        self.p: E = None
        self.s: H = None
        self.v: A = None
        self.txt = txt

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

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

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

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

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

f = A("f")
i = B("i")
c = C("c")
h = D("h")
m = E("m")
d = F("d")
g = G("g")
l = H("l")
k = F("k")

f.z = g
f.p = h
f.s = k
i.x = f
i.p = c
i.v = h
i.o = h
i.t = l
c.q = d
c.w = h
c.p = m
c.s = l
c.v = f
h.p = d
m.x = i
m.p = f
m.w = f
m.z = c
m.t = c
m.u = g
d.y = i
d.q = f
d.x = l
d.v = c
g.t = f
g.q = h
l.t = f
l.z = g
k.y = i
k.q = f
k.x = l
k.v = c
assert f.p.p.v.w.p.y.v.p.v.txt == "c"