class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.p: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: A = None
        self.z: C = None
        self.s: C = None
        self.o: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.t: A = None
        self.v: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: D = None
        self.q: A = None
        self.u: C = None
        self.s: G = None
        self.z: H = None
        self.x: B = None
        self.p: H = None
        self.r: G = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.v: D = None
        self.t: F = None
        self.w: E = None
        self.txt = txt

b = A("b")
f = B("f")
d = C("d")
a = D("a")
g = E("g")
m = F("m")
e = G("e")
i = H("i")

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

class B:
    def __init__(self, txt: str):
        self.y: A = None
        self.z: C = None
        self.s: C = None
        self.o: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.t: A = None
        self.v: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: D = None
        self.q: A = None
        self.u: C = None
        self.s: G = None
        self.z: H = None
        self.x: B = None
        self.p: H = None
        self.r: G = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.v: D = None
        self.t: F = None
        self.w: E = None
        self.txt = txt

b = A("b")
f = B("f")
d = C("d")
a = D("a")
g = E("g")
m = F("m")
e = G("e")
i = H("i")

b.u = a
b.p = f
f.y = b
f.z = d
f.s = d
f.o = m
d.y = g
d.t = b
d.v = i
a.r = m
g.w = a
g.q = b
g.u = d
g.s = e
g.r = e
g.z = i
g.p = i
g.x = f
m.r = f
m.v = f
m.z = d
m.q = d
m.x = b
m.s = b
m.u = i
e.p = m
e.r = a
e.z = a
e.s = b
e.w = d
e.t = f
i.v = a
i.t = m
i.w = g
assert f.y.u.r.x.p.y.u.txt == "a"