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

class B:
    def __init__(self, txt: str):
        self.w: A = None
        self.q: C = None
        self.p: G = None
        self.y: A = None
        self.x: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: A = None
        self.w: A = None
        self.p: D = None
        self.r: A = None
        self.x: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.w: A = None
        self.q: C = None
        self.p: G = None
        self.y: A = None
        self.x: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: A = None
        self.w: A = None
        self.p: D = None
        self.r: A = None
        self.x: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: G = None
        self.txt = txt

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

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