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

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

class C:
    def __init__(self, txt: str):
        self.y: B = None
        self.v: G = None
        self.r: F = None
        self.u: F = None
        self.q: A = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.v: G = None
        self.p: D = None
        self.q: B = None
        self.txt = txt

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

l = A("l")
h = B("h")
n = C("n")
i = D("i")
j = E("j")
a = F("a")
f = G("f")
e = C("e")
m = D("m")

l.q = i
h.t = f
h.s = l
h.o = j
n.y = h
n.v = f
n.r = a
n.u = a
n.q = l
i.r = j
i.x = l
i.u = l
i.z = m
j.z = f
j.r = e
j.s = l
a.v = f
a.p = i
a.q = h
f.o = h
f.p = a
e.y = h
e.v = f
e.r = a
e.u = a
e.q = l
m.r = j
m.x = l
m.u = l
m.z = i
assert e.v.o.o.r.txt == "
class A:
    def __init__(self, txt: str):
        self.q: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: B = None
        self.v: G = None
        self.r: F = None
        self.u: F = None
        self.q: A = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.v: G = None
        self.p: D = None
        self.q: B = None
        self.txt = txt

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

l = A("l")
h = B("h")
n = C("n")
i = D("i")
j = E("j")
a = F("a")
f = G("f")
e = C("e")
m = D("m")

l.q = i
h.t = f
h.s = l
h.o = j
n.y = h
n.v = f
n.r = a
n.u = a
n.q = l
i.r = j
i.x = l
i.u = l
i.z = m
j.z = f
j.r = e
j.s = l
a.v = f
a.p = i
a.q = h
f.o = h
f.p = a
e.y = h
e.v = f
e.r = a
e.u = a
e.q = l
m.r = j
m.x = l
m.u = l
m.z = i
assert e.v.o.o.r.txt == "e"