class A:
    def __init__(self, txt: str):
        self.p: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.x: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: G = None
        self.r: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: G = None
        self.r: H = None
        self.o: I = None
        self.q: A = None
        self.u: A = None
        self.txt = txt

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

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.x: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: G = None
        self.r: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: G = None
        self.r: H = None
        self.o: I = None
        self.q: A = None
        self.u: A = None
        self.txt = txt

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

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

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

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

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

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

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