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

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

class C:
    def __init__(self, txt: str):
        self.q: F = None
        self.x: E = None
        self.t: E = None
        self.v: B = None
        self.w: D = None
        self.u: D = None
        self.r: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.x: B = None
        self.w: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: F = None
        self.v: A = None
        self.t: A = None
        self.s: D = None
        self.u: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.x: A = None
        self.u: D = None
        self.v: D = None
        self.q: G = None
        self.w: A = None
        self.r: D = None
        self.txt = txt

a = A("a")
b = B("b")
i = C("i")
j = D("j")
g = E("g")
m = F("m")
n = G("n")
f = H("f")
c = F("c")
k = B("k")

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

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

class C:
    def __init__(self, txt: str):
        self.q: F = None
        self.x: E = None
        self.t: E = None
        self.v: B = None
        self.w: D = None
        self.u: D = None
        self.r: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.x: B = None
        self.w: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: F = None
        self.v: A = None
        self.t: A = None
        self.s: D = None
        self.u: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.x: A = None
        self.u: D = None
        self.v: D = None
        self.q: G = None
        self.w: A = None
        self.r: D = None
        self.txt = txt

a = A("a")
b = B("b")
i = C("i")
j = D("j")
g = E("g")
m = F("m")
n = G("n")
f = H("f")
c = F("c")
k = B("k")

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