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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: H = None
        self.v: D = None
        self.y: A = None
        self.p: G = None
        self.q: E = None
        self.x: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: I = None
        self.w: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: F = None
        self.z: E = None
        self.v: B = None
        self.s: F = None
        self.w: A = None
        self.t: B = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: H = None
        self.v: D = None
        self.y: A = None
        self.p: G = None
        self.q: E = None
        self.x: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: I = None
        self.w: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: F = None
        self.z: E = None
        self.v: B = None
        self.s: F = None
        self.w: A = None
        self.t: B = None
        self.txt = txt

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

a.r = l
a.u = m
a.x = f
f.t = g
f.z = m
k.x = d
k.v = f
k.q = m
k.y = m
k.p = a
l.r = g
l.w = f
l.x = f
l.p = f
l.u = a
l.s = a
l.q = e
l.t = e
l.y = d
e.r = a
e.u = k
m.w = d
m.v = l
m.y = a
m.p = g
m.q = e
m.x = k
g.t = e
d.o = c
d.w = m
c.r = m
c.s = m
c.z = e
c.v = f
c.t = f
c.w = a
assert l.t.u.y.w.w.p.t.txt == "e"