class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.o: F = None
        self.txt = txt

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.t: E = None
        self.z: C = None
        self.p: F = None
        self.y: E = None
        self.r: H = None
        self.q: B = None
        self.x: D = None
        self.o: D = None
        self.txt = txt

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

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

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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.t: E = None
        self.z: C = None
        self.p: F = None
        self.y: E = None
        self.r: H = None
        self.q: B = None
        self.x: D = None
        self.o: D = None
        self.txt = txt

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

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

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