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

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

class C:
    def __init__(self, txt: str):
        self.q: H = None
        self.o: I = None
        self.r: F = None
        self.y: E = None
        self.v: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: H = None
        self.v: F = None
        self.w: E = None
        self.p: A = None
        self.x: I = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: D = None
        self.r: E = None
        self.q: E = None
        self.z: D = None
        self.y: E = None
        self.o: I = None
        self.w: D = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.q: H = None
        self.o: I = None
        self.r: F = None
        self.y: E = None
        self.v: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: H = None
        self.v: F = None
        self.w: E = None
        self.p: A = None
        self.x: I = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: D = None
        self.r: E = None
        self.q: E = None
        self.z: D = None
        self.y: E = None
        self.o: I = None
        self.w: D = None
        self.txt = txt

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

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

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

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

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