class A:
    def __init__(self, txt: str):
        self.v: G = None
        self.w: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: H = None
        self.o: F = None
        self.y: E = None
        self.w: G = None
        self.u: H = None
        self.z: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: H = None
        self.y: B = None
        self.s: C = None
        self.u: E = None
        self.v: E = None
        self.txt = txt

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

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

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

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

j = A("j")
f = B("f")
m = C("m")
e = D("e")
g = E("g")
n = F("n")
i = G("i")
b = H("b")
l = E("l")

j.v = i
j.w = e
f.s = b
f.u = b
f.o = n
f.y = g
f.w = i
f.z = e
m.s = f
e.t = b
e.y = f
e.s = m
e.u = g
e.v = l
g.x = f
g.y = j
n.s = m
n.x = m
n.v = e
i.q = e
i.u = b
b.r = e
b.x = n
b.q = n
b.v = l
l.x = f
l.y = j
assert j.w.u.x.txt == "
class A:
    def __init__(self, txt: str):
        self.v: G = None
        self.w: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: H = None
        self.o: F = None
        self.y: E = None
        self.w: G = None
        self.u: H = None
        self.z: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: H = None
        self.y: B = None
        self.s: C = None
        self.u: E = None
        self.v: E = None
        self.txt = txt

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

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

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

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

j = A("j")
f = B("f")
m = C("m")
e = D("e")
g = E("g")
n = F("n")
i = G("i")
b = H("b")
l = E("l")

j.v = i
j.w = e
f.s = b
f.u = b
f.o = n
f.y = g
f.w = i
f.z = e
m.s = f
e.t = b
e.y = f
e.s = m
e.u = g
e.v = l
g.x = f
g.y = j
n.s = m
n.x = m
n.v = e
i.q = e
i.u = b
b.r = e
b.x = n
b.q = n
b.v = l
l.x = f
l.y = j
assert j.w.u.x.txt == "f"