class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.y: F = None
        self.x: E = None
        self.q: I = None
        self.r: H = None
        self.z: D = None
        self.p: D = None
        self.txt = txt

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.p: D = None
        self.z: E = None
        self.y: C = None
        self.u: C = None
        self.q: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: D = None
        self.r: G = None
        self.x: A = None
        self.t: C = None
        self.txt = txt

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

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

c.u = d
c.x = d
c.y = e
c.q = f
c.r = m
c.z = a
c.p = a
l.y = f
l.t = f
n.z = a
n.x = c
a.z = c
a.t = c
a.y = d
a.r = l
d.o = m
d.z = n
d.s = l
e.t = c
e.y = f
e.s = a
b.p = a
b.z = d
b.y = n
b.u = n
b.q = l
m.s = a
m.r = b
m.x = c
m.t = n
f.o = c
assert d.o.r.p.txt == "
class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.y: F = None
        self.x: E = None
        self.q: I = None
        self.r: H = None
        self.z: D = None
        self.p: D = None
        self.txt = txt

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.p: D = None
        self.z: E = None
        self.y: C = None
        self.u: C = None
        self.q: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: D = None
        self.r: G = None
        self.x: A = None
        self.t: C = None
        self.txt = txt

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

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

c.u = d
c.x = d
c.y = e
c.q = f
c.r = m
c.z = a
c.p = a
l.y = f
l.t = f
n.z = a
n.x = c
a.z = c
a.t = c
a.y = d
a.r = l
d.o = m
d.z = n
d.s = l
e.t = c
e.y = f
e.s = a
b.p = a
b.z = d
b.y = n
b.u = n
b.q = l
m.s = a
m.r = b
m.x = c
m.t = n
f.o = c
assert d.o.r.p.txt == "a"