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

class B:
    def __init__(self, txt: str):
        self.u: G = None
        self.v: F = None
        self.q: A = None
        self.s: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.y: E = None
        self.x: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: G = None
        self.u: A = None
        self.o: B = None
        self.y: B = None
        self.v: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: G = None
        self.q: G = None
        self.r: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: A = None
        self.o: H = None
        self.r: F = None
        self.z: A = None
        self.q: H = None
        self.v: F = None
        self.txt = txt

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

b = A("b")
n = B("n")
f = C("f")
l = D("l")
g = E("g")
i = F("i")
d = G("d")
k = H("k")

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

class B:
    def __init__(self, txt: str):
        self.u: G = None
        self.v: F = None
        self.q: A = None
        self.s: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.y: E = None
        self.x: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: G = None
        self.u: A = None
        self.o: B = None
        self.y: B = None
        self.v: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: G = None
        self.q: G = None
        self.r: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: A = None
        self.o: H = None
        self.r: F = None
        self.z: A = None
        self.q: H = None
        self.v: F = None
        self.txt = txt

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

b = A("b")
n = B("n")
f = C("f")
l = D("l")
g = E("g")
i = F("i")
d = G("d")
k = H("k")

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