class A:
    def __init__(self, txt: str):
        self.p: E = None
        self.x: D = None
        self.z: D = None
        self.t: E = None
        self.v: B = None
        self.w: F = None
        self.y: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: F = None
        self.x: I = None
        self.p: G = None
        self.q: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: I = None
        self.o: C = None
        self.w: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: E = None
        self.x: B = None
        self.y: I = None
        self.q: C = None
        self.r: B = None
        self.w: B = None
        self.u: B = None
        self.txt = txt

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

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

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

c = A("c")
n = B("n")
g = C("g")
f = D("f")
h = E("h")
k = F("k")
j = G("j")
a = H("a")
l = I("l")

c.p = h
c.t = h
c.x = f
c.z = f
c.v = n
c.w = k
c.y = k
n.z = g
n.r = f
n.o = a
g.o = k
g.x = l
g.p = j
g.q = c
f.p = l
f.o = g
f.w = j
h.u = g
k.z = h
k.x = n
k.r = n
k.w = n
k.u = n
k.y = l
k.q = g
j.q = k
j.z = a
a.t = n
a.w = g
l.r = h
l.x = f
assert l.x.p.x.txt == "
class A:
    def __init__(self, txt: str):
        self.p: E = None
        self.x: D = None
        self.z: D = None
        self.t: E = None
        self.v: B = None
        self.w: F = None
        self.y: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: F = None
        self.x: I = None
        self.p: G = None
        self.q: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: I = None
        self.o: C = None
        self.w: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: E = None
        self.x: B = None
        self.y: I = None
        self.q: C = None
        self.r: B = None
        self.w: B = None
        self.u: B = None
        self.txt = txt

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

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

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

c = A("c")
n = B("n")
g = C("g")
f = D("f")
h = E("h")
k = F("k")
j = G("j")
a = H("a")
l = I("l")

c.p = h
c.t = h
c.x = f
c.z = f
c.v = n
c.w = k
c.y = k
n.z = g
n.r = f
n.o = a
g.o = k
g.x = l
g.p = j
g.q = c
f.p = l
f.o = g
f.w = j
h.u = g
k.z = h
k.x = n
k.r = n
k.w = n
k.u = n
k.y = l
k.q = g
j.q = k
j.z = a
a.t = n
a.w = g
l.r = h
l.x = f
assert l.x.p.x.txt == "f"