class A:
    def __init__(self, txt: str):
        self.t: I = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: G = None
        self.w: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: H = None
        self.u: D = None
        self.y: F = None
        self.p: B = None
        self.t: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: I = None
        self.s: I = None
        self.z: A = None
        self.v: A = None
        self.x: A = None
        self.w: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.z: G = None
        self.r: D = None
        self.s: B = None
        self.t: G = None
        self.w: D = None
        self.x: I = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.u: C = None
        self.w: H = None
        self.t: A = None
        self.v: E = None
        self.p: H = None
        self.x: A = None
        self.y: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.t: G = None
        self.w: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: H = None
        self.u: D = None
        self.y: F = None
        self.p: B = None
        self.t: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: I = None
        self.s: I = None
        self.z: A = None
        self.v: A = None
        self.x: A = None
        self.w: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.z: G = None
        self.r: D = None
        self.s: B = None
        self.t: G = None
        self.w: D = None
        self.x: I = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.u: C = None
        self.w: H = None
        self.t: A = None
        self.v: E = None
        self.p: H = None
        self.x: A = None
        self.y: F = None
        self.txt = txt

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

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