class A:
    def __init__(self, txt: str):
        self.z: E = None
        self.x: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.o: B = None
        self.s: G = None
        self.p: C = None
        self.y: G = None
        self.w: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: C = None
        self.txt = txt

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

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

n = A("n")
g = B("g")
c = C("c")
b = D("b")
l = E("l")
a = F("a")
d = G("d")
e = H("e")
j = F("j")
f = E("f")

n.z = l
n.x = b
g.p = b
g.z = b
g.v = b
g.o = e
g.s = c
c.w = g
c.u = g
b.o = g
b.s = d
b.y = d
b.p = c
b.w = l
l.x = d
l.o = j
a.z = c
d.z = n
d.p = l
e.w = n
e.t = n
e.v = g
e.r = b
j.z = c
f.x = d
f.o = j
assert c.u.o.v.txt == "
class A:
    def __init__(self, txt: str):
        self.z: E = None
        self.x: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.o: B = None
        self.s: G = None
        self.p: C = None
        self.y: G = None
        self.w: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: C = None
        self.txt = txt

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

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

n = A("n")
g = B("g")
c = C("c")
b = D("b")
l = E("l")
a = F("a")
d = G("d")
e = H("e")
j = F("j")
f = E("f")

n.z = l
n.x = b
g.p = b
g.z = b
g.v = b
g.o = e
g.s = c
c.w = g
c.u = g
b.o = g
b.s = d
b.y = d
b.p = c
b.w = l
l.x = d
l.o = j
a.z = c
d.z = n
d.p = l
e.w = n
e.t = n
e.v = g
e.r = b
j.z = c
f.x = d
f.o = j
assert c.u.o.v.txt == "g"