class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.p: B = None
        self.x: C = None
        self.v: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: F = None
        self.r: E = None
        self.x: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: I = None
        self.x: G = None
        self.u: B = None
        self.q: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: B = None
        self.txt = txt

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.o: F = None
        self.r: E = None
        self.x: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: I = None
        self.x: G = None
        self.u: B = None
        self.q: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: B = None
        self.txt = txt

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

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

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

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

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

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