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

class B:
    def __init__(self, txt: str):
        self.q: A = None
        self.u: F = None
        self.v: F = None
        self.w: G = None
        self.s: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: E = None
        self.x: C = None
        self.t: D = None
        self.r: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: G = None
        self.z: E = None
        self.y: G = None
        self.q: B = None
        self.txt = txt

c = A("c")
a = B("a")
h = C("h")
i = D("i")
f = E("f")
e = F("e")
k = G("k")
d = H("d")

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

class B:
    def __init__(self, txt: str):
        self.q: A = None
        self.u: F = None
        self.v: F = None
        self.w: G = None
        self.s: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: E = None
        self.x: C = None
        self.t: D = None
        self.r: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: G = None
        self.z: E = None
        self.y: G = None
        self.q: B = None
        self.txt = txt

c = A("c")
a = B("a")
h = C("h")
i = D("i")
f = E("f")
e = F("e")
k = G("k")
d = H("d")

c.o = k
c.s = k
c.p = i
a.q = c
a.u = e
a.v = e
a.w = k
a.s = d
h.x = k
i.p = f
f.y = a
e.x = h
e.q = a
e.t = d
k.p = f
k.x = h
k.t = i
k.r = c
d.u = k
d.y = k
d.z = f
d.q = a
assert c.s.x.x.txt == "k"